InstanceControl クラス

このクラスには、CommandReceive および CommandSend オブジェクトを取得するために使用できるメソッドがあります。これらのオブジェクトを使用すると、インスタンス ストアのコマンド キューの間でコマンドを送受信することができます。

名前空間: Microsoft.ApplicationServer.StoreManagement.Control
アセンブリ: Microsoft.ApplicationServer.StoreManagement (microsoft.applicationserver.storemanagement.dll)

使用法

構文

'宣言
Public MustInherit Class InstanceControl
public abstract class InstanceControl
public ref class InstanceControl abstract
public abstract class InstanceControl
public abstract class InstanceControl

解説

インスタンス制御コマンドレットは、CommandSend オブジェクトを使用してコマンドをコマンド キューに登録し、Workflow Management Service (WMS) は CommandReceive オブジェクトを使用してコマンド キューからコマンドを除去します。Remove-ASAppServiceInstance コマンドレットの実行時など、場合によっては、ストアそれ自体がコマンドを処理してインスタンス ストアからインスタンスを削除します。

次のコードに、このクラスのサンプル実装を示します。

    public class MySqlInstanceControl : InstanceControl
    {
        readonly string connectionString;
         public MySqlInstanceControl(string connectionString)
         {
             this.connectionString = connectionString;
         }

        MySqlCommandReceive commandReceive;
        public override CommandReceive CommandReceive
        {
            get 
            {
                if (this.commandReceive == null)
                {
                    MySqlCommandReceive tmp = new MySqlCommandReceive(this.connectionString);
                    Interlocked.CompareExchange(ref this.commandReceive, tmp, null);
                }
                return this.commandReceive;
            }
        }

        MySqlCommandSend commandSend;
        public override CommandSend CommandSend
        {
            get
            {
                if (this.commandSend == null)
                {
                    MySqlCommandSend tmp = new MySqlCommandSend(this.connectionString);
                    Interlocked.CompareExchange(ref this.commandSend, tmp, null);
                    return this.commandSend;
                }
                return this.CommandSend;
            }
        }
    }

継承の階層

System.Object
  Microsoft.ApplicationServer.StoreManagement.Control.InstanceControl
     Microsoft.ApplicationServer.StoreManagement.Sql.Control.SqlInstanceControl

スレッド セーフ

この型のパブリック静的 (Visual Basic では Shared ) メンバーはスレッド セーフです。インスタンスのメンバーはいずれも、スレッド セーフである保証はありません。

プラットフォーム

開発プラットフォーム

Visual Studio 2010 およびそれ以降, .NET Framework 4

対象プラットフォーム

Windows 7; Windows Server 2008 R2; Windows Server 2008 Service Pack 2; Windows Vista Service Pack 2

Change History

関連項目

参照

InstanceControl メンバー
Microsoft.ApplicationServer.StoreManagement.Control 名前空間