MessageType
- the type of message being handledpublic class BasicMessageHandlerChain<MessageType> extends AbstractMessageHandler<MessageType> implements MessageHandlerChain<MessageType>
MessageHandlerChain
.Constructor and Description |
---|
BasicMessageHandlerChain() |
Modifier and Type | Method and Description |
---|---|
void |
doInvoke(MessageContext<MessageType> msgContext)
Performs the handler logic.
|
List<MessageHandler<MessageType>> |
getHandlers()
Get the ordered list of message handlers which comprise the handler chain.
|
void |
setHandlers(List<MessageHandler<MessageType>> handlers)
Set the list of message handler chain members.
|
doPostInvoke, doPostInvoke, doPreInvoke, getLogPrefix, invoke
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
invoke
@NonnullAfterInit @NonnullElements public List<MessageHandler<MessageType>> getHandlers()
The returned list is immutable. Changes to the list
should be accomplished through setHandlers(List)
.
getHandlers
in interface MessageHandlerChain<MessageType>
public void setHandlers(@Nullable @NonnullElements List<MessageHandler<MessageType>> handlers)
The supplied list is copied before being stored. Later modifications to the originally supplied list will not be reflected in the handler chain membership.
handlers
- the list of message handler memberspublic void doInvoke(@Nonnull MessageContext<MessageType> msgContext) throws MessageHandlerException
doInvoke
in class AbstractMessageHandler<MessageType>
msgContext
- the message context on which to invoke the handlerMessageHandlerException
- if there is an error invoking the handler on the message contextCopyright © 2016. All rights reserved.