Class BasicMessageHandlerChain

All Implemented Interfaces:
Component, DestructableComponent, InitializableComponent, MessageHandler, MessageHandlerChain

public class BasicMessageHandlerChain extends AbstractMessageHandler implements MessageHandlerChain
A basic implementation of MessageHandlerChain.
  • Field Details

  • Constructor Details

    • BasicMessageHandlerChain

      public BasicMessageHandlerChain()
  • Method Details

    • getHandlers

      Get the ordered list of message handlers which comprise the handler chain.

      The returned list is immutable. Changes to the list should be accomplished through setHandlers(List).

      Specified by:
      getHandlers in interface MessageHandlerChain
      Returns:
      the list of members of the handler chain
    • setHandlers

      public void setHandlers(@Nullable List<MessageHandler> handlers)
      Set the list of message handler chain members.

      The supplied list is copied before being stored. Later modifications to the originally supplied list will not be reflected in the handler chain membership.

      Parameters:
      handlers - the list of message handler members
    • doInvoke

      public void doInvoke(@Nonnull MessageContext msgContext) throws MessageHandlerException
      Performs the handler logic.
      Specified by:
      doInvoke in class AbstractMessageHandler
      Parameters:
      msgContext - the message context on which to invoke the handler
      Throws:
      MessageHandlerException - if there is an error invoking the handler on the message context