IServerChannelSinkProviderとは? わかりやすく解説

IServerChannelSinkProvider インターフェイス

リモート処理メッセージ流れているサーバー チャネルサーバー チャネル シンク作成します

名前空間: System.Runtime.Remoting.Channels
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<ComVisibleAttribute(True)> _
Public Interface IServerChannelSinkProvider
Dim instance As IServerChannelSinkProvider
[ComVisibleAttribute(true)] 
public interface IServerChannelSinkProvider
[ComVisibleAttribute(true)] 
public interface class IServerChannelSinkProvider
/** @attribute ComVisibleAttribute(true) */ 
public interface IServerChannelSinkProvider
ComVisibleAttribute(true) 
public interface IServerChannelSinkProvider
解説解説

チャネル シンクは、IServerChannelSinkProvider インターフェイス実装とおしてサーバー チャネル接続されます。すべてのリモート処理サーバー チャネルには、パラメータとして IServerChannelSinkProvider受け取コンストラクタ用意されています。

チャネル シンク プロバイダチェイン格納されます。外部チャネル シンク プロバイダチャネル コンストラクタに渡す場合は、その前にすべてのチャネル シンク プロバイダ1 つチェインにまとめます。この処理を実行できるようにするために、IServerChannelSinkProviderNext というプロパティ提供します

複数チャネル シンク プロバイダ構成ファイル指定されている場合リモート処理インフラストラクチャは、構成ファイル出現する順序でそれらのプロバイダチェイン含めます。チャネル シンク プロバイダは、RemotingConfiguration.Configure 呼び出し中にチャネル同時に作成されます。

IMethodCallMessage が生成されると、.NET Framework登録されチャネルリスト内を検索し、この呼び出し処理できるチャネルを見つけます適切なチャネル見つかったら、そのチャネルからチャネル シンク取得されIMethodCallMessage が処理のためにそのシンク転送されます。

使用例使用例

このインターフェイス実装を示すコード例次に示します

public class ServerSinkProvider : IServerChannelSinkProvider
{

    // The next provider in the chain.
    private IServerChannelSinkProvider nextProvider;

    public IServerChannelSinkProvider Next
    {
        [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure)]
        get
        {
            return(nextProvider);
        }
        [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure)]
        set
        {
            nextProvider = value;
        }
    }

    [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure)]
    public IServerChannelSink CreateSink (IChannelReceiver channel)
    {

        Console.WriteLine("Creating ServerSink");

        // Create the next sink in the chain.
        IServerChannelSink nextSink = nextProvider.CreateSink(channel);

        // Hook our sink up to it.
        return( new ServerSink(nextSink) );
    }

    [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure)]
    public void GetChannelData (IChannelDataStore
 channelData) {}

    // This constructor is required in order to use the provider in
 file-based configuration.
    // It need not do anything unless you want to use the information
 in the parameters.
    public ServerSinkProvider (IDictionary properties, ICollection
 providerData) {}
    
}
[System::Security::Permissions::PermissionSet(System::Security::
   Permissions::SecurityAction::Demand, Name = "FullTrust")]
public ref class ServerSinkProvider: public
 IServerChannelSinkProvider
{
   // The next provider in the chain.
private:
   IServerChannelSinkProvider^ nextProvider;

public:
   property IServerChannelSinkProvider^ Next 
   {
      virtual IServerChannelSinkProvider^ get()
      {
         return (nextProvider);
      }

      virtual void set( IServerChannelSinkProvider^
 value )
      {
         nextProvider = value;
      }
   }

   virtual IServerChannelSink^ CreateSink( IChannelReceiver^ channel )
   {
      Console::WriteLine( "Creating ServerSink" );

      // Create the next sink in the chain.
      IServerChannelSink^ nextSink = nextProvider->CreateSink( channel );

      // Hook our sink up to it.
      return (gcnew ServerSink( nextSink ));
   }

   virtual void GetChannelData( IChannelDataStore^ /*channelData*/
 ){}

   // This constructor is required in order to use the provider in file-based
 configuration.
   // It need not do anything unless you want to use the information
 in the parameters.
   ServerSinkProvider( IDictionary^ /*properties*/, ICollection^ /*providerData*/
 ){}
};
/** @attribute SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.Infrastructure)
*/
public class ServerSinkProvider implements
 IServerChannelSinkProvider
{
    // The next provider in the chain.
    private IServerChannelSinkProvider nextProvider;

    /** @property 
     */
    public IServerChannelSinkProvider get_Next()
    {
        return nextProvider;
    }//get_Next

    /** @property 
     */
    public void set_Next(IServerChannelSinkProvider
 value)
    {
        nextProvider = value;
    }//set_Next

    public IServerChannelSink CreateSink(IChannelReceiver channel)
    {
        Console.WriteLine("Creating ServerSink");
        // Create the next sink in the chain.
        IServerChannelSink nextSink = nextProvider.CreateSink(channel);
        // Hook our sink up to it.
        return new ServerSink(nextSink);
    } //CreateSink

    public void GetChannelData(IChannelDataStore
 channelData)
    {
    } //GetChannelData

    // This constructor is required in order to use the provider in
 file-based
    //configuration. It need not do anything unless you want to use
 the 
    // information in the parameters.
    public ServerSinkProvider(IDictionary properties, ICollection
 providerData)
    {
    } //ServerSinkProvider 
} //ServerSinkProvider

対応するサーバー シンク実装例については、IServerChannelSink インターフェイスドキュメント参照してください

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
IServerChannelSinkProvider メンバ
System.Runtime.Remoting.Channels 名前空間

IServerChannelSinkProvider プロパティ


IServerChannelSinkProvider メソッド


パブリック メソッドパブリック メソッド

参照参照

関連項目

IServerChannelSinkProvider インターフェイス
System.Runtime.Remoting.Channels 名前空間

IServerChannelSinkProvider メンバ




英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「IServerChannelSinkProvider」の関連用語

IServerChannelSinkProviderのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



IServerChannelSinkProviderのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS