SendMessageChannelCache コンストラクター

定義

SendMessageChannelCache クラスの新しいインスタンスを初期化します。

オーバーロード

SendMessageChannelCache()

既定のファクトリ キャッシュおよびチャネル キャッシュ設定を使用して、SendMessageChannelCache クラスの新しいインスタンスを初期化します。

SendMessageChannelCache(ChannelCacheSettings, ChannelCacheSettings)

カスタム ファクトリ キャッシュおよびチャネル キャッシュ設定を使用して、SendMessageChannelCache クラスの新しいインスタンスを初期化します。

SendMessageChannelCache(ChannelCacheSettings, ChannelCacheSettings, Boolean)

カスタム ファクトリ キャッシュ設定、カスタム チャネル キャッシュ設定、およびキャッシュを有効にするかどうかを示す値を使用して、SendMessageChannelCache クラスの新しいインスタンスを初期化します。

SendMessageChannelCache()

既定のファクトリ キャッシュおよびチャネル キャッシュ設定を使用して、SendMessageChannelCache クラスの新しいインスタンスを初期化します。

public:
 SendMessageChannelCache();
public SendMessageChannelCache ();
Public Sub New ()

適用対象

SendMessageChannelCache(ChannelCacheSettings, ChannelCacheSettings)

カスタム ファクトリ キャッシュおよびチャネル キャッシュ設定を使用して、SendMessageChannelCache クラスの新しいインスタンスを初期化します。

public:
 SendMessageChannelCache(System::ServiceModel::Activities::ChannelCacheSettings ^ factorySettings, System::ServiceModel::Activities::ChannelCacheSettings ^ channelSettings);
public SendMessageChannelCache (System.ServiceModel.Activities.ChannelCacheSettings factorySettings, System.ServiceModel.Activities.ChannelCacheSettings channelSettings);
new System.ServiceModel.Activities.SendMessageChannelCache : System.ServiceModel.Activities.ChannelCacheSettings * System.ServiceModel.Activities.ChannelCacheSettings -> System.ServiceModel.Activities.SendMessageChannelCache
Public Sub New (factorySettings As ChannelCacheSettings, channelSettings As ChannelCacheSettings)

パラメーター

factorySettings
ChannelCacheSettings

キャッシュされたチャネル ファクトリのキャッシュ設定。

channelSettings
ChannelCacheSettings

キャッシュされたチャネルのキャッシュ設定。

次の例では、SendMessageChannelCache クラスを使用して、単一のアプリケーション ドメイン内の 2 つのワークフロー アプリケーション間でチャネル キャッシュを共有する方法を示します。


//sharing a channel cache between two workflow applications in a single app-domain.
sharedChannelCache = new SendMessageChannelCache(new ChannelCacheSettings { MaxItemsInCache = 5 }, new ChannelCacheSettings { MaxItemsInCache = 5 });

WorkflowApplication workflowApp1 = new WorkflowApplication(workflow);
workflowApp1.Completed = new Action<WorkflowApplicationCompletedEventArgs>(OnCompleted);
workflowApp1.Extensions.Add(sharedChannelCache);

WorkflowApplication workflowApp2 = new WorkflowApplication(workflow);
workflowApp2.Completed = new Action<WorkflowApplicationCompletedEventArgs>(OnCompleted);
workflowApp2.Extensions.Add(sharedChannelCache);

//disabling the channel cache so that channels are closed after being used.
SendMessageChannelCache disabledChannelCache = new SendMessageChannelCache(new ChannelCacheSettings { MaxItemsInCache = 0 }, new ChannelCacheSettings { MaxItemsInCache = 0 });

WorkflowApplication workflowApp3 = new WorkflowApplication(workflow);
workflowApp3.Completed = new Action<WorkflowApplicationCompletedEventArgs>(OnCompleted);
workflowApp3.Extensions.Add(disabledChannelCache);

注釈

チャネル ファクトリの詳細については、「ChannelFactory」および「ChannelFactory<TChannel>」を参照してください。

チャネル ファクトリ キャッシュのみを使用し、チャネル キャッシュを無効にするには、channelSettings 値が 0 の ChannelCacheSettings インスタンスに初期化されたこのコンストラクターに MaxItemsInCache パラメーターを渡します。 チャネル ファクトリ キャッシュとチャネル キャッシュの両方のキャッシュを完全に無効にするには、factorySettings 値が 0 の ChannelCacheSettings インスタンスに初期化されたこのコンストラクターに MaxItemsInCache パラメーターを渡します。 チャネル ファクトリ キャッシュが無効になっているときにチャネル キャッシュを有効にすることはできません。

適用対象

SendMessageChannelCache(ChannelCacheSettings, ChannelCacheSettings, Boolean)

カスタム ファクトリ キャッシュ設定、カスタム チャネル キャッシュ設定、およびキャッシュを有効にするかどうかを示す値を使用して、SendMessageChannelCache クラスの新しいインスタンスを初期化します。

public:
 SendMessageChannelCache(System::ServiceModel::Activities::ChannelCacheSettings ^ factorySettings, System::ServiceModel::Activities::ChannelCacheSettings ^ channelSettings, bool allowUnsafeCaching);
public SendMessageChannelCache (System.ServiceModel.Activities.ChannelCacheSettings factorySettings, System.ServiceModel.Activities.ChannelCacheSettings channelSettings, bool allowUnsafeCaching);
new System.ServiceModel.Activities.SendMessageChannelCache : System.ServiceModel.Activities.ChannelCacheSettings * System.ServiceModel.Activities.ChannelCacheSettings * bool -> System.ServiceModel.Activities.SendMessageChannelCache
Public Sub New (factorySettings As ChannelCacheSettings, channelSettings As ChannelCacheSettings, allowUnsafeCaching As Boolean)

パラメーター

factorySettings
ChannelCacheSettings

キャッシュされたチャネル ファクトリのキャッシュ設定。

channelSettings
ChannelCacheSettings

キャッシュされたチャネルのキャッシュ設定。

allowUnsafeCaching
Boolean

キャッシュを有効にする場合は true。それ以外の場合は false

注釈

既定では、キャッシュは、構成で定義されたエンドポイントを使用しないアクティビティでのみ使用できます Send 。 ただし、この場合にキャッシュを有効にする場合は、このコンストラクターを呼び出し、パラメーターtrueallowUnsafeCaching . 次に、このクラスの新しいインスタンスをワークフロー サービス ホストまたはワークフロー インスタンスに拡張として追加します。

チャネル ファクトリの詳細については、「ChannelFactory」および「ChannelFactory<TChannel>」を参照してください。

適用対象