MessageFilter Classe
Definição
Classe base abstract
para diferentes classes de filtros, usada para consultar mensagens.abstract
base class for different classes of filters used to query messages.
public ref class MessageFilter abstract
[System.Runtime.Serialization.DataContract]
[System.Runtime.Serialization.KnownType(typeof(System.ServiceModel.Dispatcher.ActionMessageFilter))]
[System.Runtime.Serialization.KnownType(typeof(System.ServiceModel.Dispatcher.XPathMessageFilter))]
[System.Runtime.Serialization.KnownType(typeof(System.ServiceModel.Dispatcher.MatchAllMessageFilter))]
[System.Runtime.Serialization.KnownType(typeof(System.ServiceModel.Dispatcher.MatchNoneMessageFilter))]
public abstract class MessageFilter
[<System.Runtime.Serialization.DataContract>]
[<System.Runtime.Serialization.KnownType(typeof(System.ServiceModel.Dispatcher.ActionMessageFilter))>]
[<System.Runtime.Serialization.KnownType(typeof(System.ServiceModel.Dispatcher.XPathMessageFilter))>]
[<System.Runtime.Serialization.KnownType(typeof(System.ServiceModel.Dispatcher.MatchAllMessageFilter))>]
[<System.Runtime.Serialization.KnownType(typeof(System.ServiceModel.Dispatcher.MatchNoneMessageFilter))>]
type MessageFilter = class
Public MustInherit Class MessageFilter
- Herança
-
MessageFilter
- Derivado
- Atributos
Comentários
MessageFilteré uma abstract
classe que os desenvolvedores implementam a fim de especificar os critérios a serem usados para inspecionar mensagens.MessageFilter is an abstract
class that developers implement in order to specify the criteria to use for inspecting messages. Normalmente, os filtros são usados por um aplicativo de ponto de extremidade para determinar o que fazer com uma mensagem com base em um exame de alguma parte da mensagem.Typically, filters are used by an endpoint application to determine what to do with a message based on an examination of some part of the message. Um processo de enfileiramento, por exemplo, pode usar uma consulta XPath 1,0 para verificar o elemento Priority de um cabeçalho conhecido para determinar se uma mensagem deve ser movida para a frente da fila.A queuing process, for example, can use an XPath 1.0 query to check the priority element of a known header to determine whether to move a message to the front of the queue.
Os filtros são armazenados em uma tabela de filtro que implementa IMessageFilterTable<TFilterData> .Filters are stored in a filter table that implements IMessageFilterTable<TFilterData>. Cada filtro na tabela é associado a dados de filtro especificados que podem ser usados para indicar as ações a serem executadas se uma mensagem corresponder ao filtro.Each filter in the table is associated with specified filter data that can be used to indicate what actions to take if a message matches the filter. Os Match métodos são usados para determinar se uma mensagem atende a um filtro.The Match methods are used to determine if a message satisfies a filter.
Os critérios usados por um filtro não podem ser alterados depois que o filtro é construído porque as tabelas de filtro não têm como detectar uma alteração.The criteria used by a filter cannot be changed once the filter is constructed because the filter tables have no way to detect a change. A única maneira de modificar os critérios de um filtro é criar um novo e excluir o filtro existente.The only way to modify the criteria of a filter is to construct a new one and delete the existing filter.
As classes a seguir implementam a abstract
MessageFilter classe:The following classes implement the abstract
MessageFilter class:
XPathMessageFilterusa uma expressão XPath 1,0 para especificar os critérios de uma correspondência.XPathMessageFilter uses an XPath 1.0 expression to specify the criteria for a match.
MatchAllMessageFiltercorresponde a todas as mensagens.MatchAllMessageFilter matches all messages.
MatchNoneMessageFilternão corresponde a nenhuma das mensagens.MatchNoneMessageFilter matches none of the messages.
ActionMessageFiltertesta se a ação de uma mensagem é um de um conjunto especificado de ações.ActionMessageFilter tests whether the action of a message is one of a specified set of actions.
EndpointAddressMessageFiltertesta se uma mensagem atende a um endereço de ponto de extremidade especificado.EndpointAddressMessageFilter tests whether a message satisfies a specified endpoint address.
ChannelListenerBase<TChannel>é uma abstract
classe base que você pode usar para gravar ouvintes sem enfileiramento.ChannelListenerBase<TChannel> is an abstract
base class that you can use for writing non-queuing listeners.
Construtores
MessageFilter() |
Quando chamado em uma classe derivada, inicializa uma nova instância da classe MessageFilter.When called in a derived class, initializes a new instance of the MessageFilter class. |
Métodos
CreateFilterTable<FilterData>() |
Cria uma tabela de filtro para um filtro que tem um tipo de dado especificado associado.Creates a filter table for a filter that has a specified type of data associated with it. |
Equals(Object) |
Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object. (Herdado de Object) |
GetHashCode() |
Serve como a função de hash padrão.Serves as the default hash function. (Herdado de Object) |
GetType() |
Obtém o Type da instância atual.Gets the Type of the current instance. (Herdado de Object) |
Match(Message) |
Quando substituído em uma classe derivada, testa se uma mensagem atende aos critérios de filtro.When overridden in a derived class, tests whether a message satisfies the filter criteria. O corpo não pode ser examinado.The body cannot be examined. |
Match(MessageBuffer) |
Quando substituído em uma classe derivada, testa se uma mensagem em buffer atende aos critérios de filtro.When overridden in a derived class, tests whether a buffered message satisfies the criteria of a filter. |
MemberwiseClone() |
Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object. (Herdado de Object) |
ToString() |
Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object. (Herdado de Object) |