public class MessageSelectorChain extends Object implements MessageSelector
accepted
is based upon the tallied results of the individual selectors' responses in
accordance with this chain's MessageSelectorChain.VotingStrategy
.Modifier and Type | Class and Description |
---|---|
static class |
MessageSelectorChain.VotingStrategy |
Constructor and Description |
---|
MessageSelectorChain() |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Message<?> message)
Pass the message through the selector chain.
|
void |
add(int index,
MessageSelector selector)
Add a selector to the chain at the specified index.
|
void |
add(MessageSelector selector)
Add a selector to the end of the chain.
|
void |
setSelectors(List<MessageSelector> selectors)
Initialize the selector chain.
|
void |
setVotingStrategy(MessageSelectorChain.VotingStrategy votingStrategy)
Specify the voting strategy for this selector chain.
|
public void setVotingStrategy(MessageSelectorChain.VotingStrategy votingStrategy)
The default is MessageSelectorChain.VotingStrategy.ALL
.
votingStrategy
- The voting strategy.public void add(MessageSelector selector)
selector
- The message selector.public void add(int index, MessageSelector selector)
index
- The index.selector
- The message selector.public void setSelectors(List<MessageSelector> selectors)
selectors
- The message selectors.public final boolean accept(Message<?> message)
accepted
is based upon the tallied results of
the individual selectors' responses in accordance with this chain's
MessageSelectorChain.VotingStrategy
.accept
in interface GenericSelector<Message<?>>
accept
in interface MessageSelector