IClientChannelSinkProvider Interface
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Cria sumidoiros de canal cliente para o canal cliente através dos quais fluem mensagens remotas.
public interface class IClientChannelSinkProvider
public interface IClientChannelSinkProvider
[System.Runtime.InteropServices.ComVisible(true)]
public interface IClientChannelSinkProvider
type IClientChannelSinkProvider = interface
[<System.Runtime.InteropServices.ComVisible(true)>]
type IClientChannelSinkProvider = interface
Public Interface IClientChannelSinkProvider
- Derivado
- Atributos
Exemplos
O exemplo de código seguinte ilustra uma implementação desta interface.
[System::Security::Permissions::PermissionSet(System::Security::
Permissions::SecurityAction::Demand, Name = "FullTrust")]
public ref class ClientSinkProvider: public IClientChannelSinkProvider
{
private:
// The next provider in the chain.
IClientChannelSinkProvider^ nextProvider;
public:
property IClientChannelSinkProvider^ Next
{
virtual IClientChannelSinkProvider^ get()
{
return (nextProvider);
}
virtual void set( IClientChannelSinkProvider^ value )
{
nextProvider = value;
}
}
virtual IClientChannelSink^ CreateSink( IChannelSender^ channel, String^ url, Object^ remoteChannelData )
{
Console::WriteLine( "Creating ClientSink for {0}", url );
// Create the next sink in the chain.
IClientChannelSink^ nextSink = nextProvider->CreateSink( channel, url, remoteChannelData );
// Hook our sink up to it.
return (gcnew ClientSink( nextSink ));
}
// 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.
ClientSinkProvider( IDictionary^ /*properties*/, ICollection^ /*providerData*/ ){}
};
public class ClientSinkProvider : IClientChannelSinkProvider
{
// The next provider in the chain.
private IClientChannelSinkProvider nextProvider;
public IClientChannelSinkProvider Next
{
get
{
return(nextProvider);
}
set
{
nextProvider = value;
}
}
public IClientChannelSink CreateSink (IChannelSender channel, String url, Object remoteChannelData)
{
Console.WriteLine("Creating ClientSink for {0}", url);
// Create the next sink in the chain.
IClientChannelSink nextSink = nextProvider.CreateSink(channel, url, remoteChannelData);
// Hook our sink up to it.
return( new ClientSink(nextSink) );
}
// 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 ClientSinkProvider (IDictionary properties, ICollection providerData) {}
}
Consulte a documentação da IClientChannelSink interface para um exemplo da implementação correspondente do client sink.
Observações
Os sumidoiros de canal estão ligados a um canal cliente através de implementações da IClientChannelSinkProvider interface. Todos os canais de cliente remotos fornecem construtores que tomam a IClientChannelSinkProvider como parâmetro.
Os fornecedores de sumidouro de canal são armazenados numa cadeia, e o utilizador é responsável por encadear todos os fornecedores de sumidouros de canal antes de passar o externo para o construtor do canal. IClientChannelSinkProvider fornece uma propriedade chamada Next para este fim.
Quando vários fornecedores de sumidouros de canal são especificados num ficheiro de configuração, a infraestrutura remota encadea-os na ordem em que são encontrados no ficheiro de configuração. Os fornecedores de channel sink serão criados quando o canal for criado durante a RemotingConfiguration.Configure chamada.
Propriedades
| Name | Description |
|---|---|
| Next |
Obtém ou define o próximo fornecedor de sumidouros na cadeia de fornecedores de sumidouros de canal. |
Métodos
| Name | Description |
|---|---|
| CreateSink(IChannelSender, String, Object) |
Cria uma corrente de pia. |