Class ChainedMessageHandlerInterceptorMember<T>

java.lang.Object
org.axonframework.messaging.core.interception.annotation.ChainedMessageHandlerInterceptorMember<T>
Type Parameters:
T - The type that declares the handlers in this chain.
All Implemented Interfaces:
MessageHandlerInterceptorMemberChain<T>

public class ChainedMessageHandlerInterceptorMember<T> extends Object implements MessageHandlerInterceptorMemberChain<T>
A MessageHandlerInterceptorMemberChain implementation that constructs a chain of instances of itself based on a given iterator of MessageHandlingMembers.
Since:
4.4.0
Author:
Allard Buijze
  • Constructor Details

    • ChainedMessageHandlerInterceptorMember

      public ChainedMessageHandlerInterceptorMember(Iterator<MessageHandlingMember<? super T>> iterator)
      Constructs a chained message handling interceptor, building a chain from the given iterator.

      The iterator should at least> have a single MessageHandlingMember. If there are more MessageHandlingMembers present in the given iterator, this constructor will be invoked again.

      Parameters:
      iterator - the MessageHandlingMembers from which to construct the chain.
  • Method Details

    • handle

      public MessageStream<?> handle(Message message, ProcessingContext context, @Nullable T target, MessageHandlingMember<? super T> handler)
      Description copied from interface: MessageHandlerInterceptorMemberChain
      Invokes the interceptors in this chain for the given message, ultimately invoking the given handler unless an interceptor short-circuits the chain.
      Specified by:
      handle in interface MessageHandlerInterceptorMemberChain<T>
      Parameters:
      message - the message to intercept and, ultimately, handle
      context - the context under which the message is processed
      target - the instance declaring the interceptors and the handler, or null when there is no instance to invoke them on, in which case this chain must only contain static members
      handler - the handler to invoke once every interceptor has proceeded the chain
      Returns:
      a stream containing the result of handling the message