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 Summary
ConstructorsConstructorDescriptionChainedMessageHandlerInterceptorMember(Iterator<MessageHandlingMember<? super T>> iterator) Constructs a chained message handling interceptor, building a chain from the giveniterator. -
Method Summary
Modifier and TypeMethodDescriptionhandle(Message message, ProcessingContext context, @Nullable T target, MessageHandlingMember<? super T> handler) Invokes the interceptors in this chain for the givenmessage, ultimately invoking the givenhandlerunless an interceptor short-circuits the chain.
-
Constructor Details
-
ChainedMessageHandlerInterceptorMember
Constructs a chained message handling interceptor, building a chain from the giveniterator.The
iteratorshould at least> have a singleMessageHandlingMember. If there are moreMessageHandlingMemberspresent in the giveniterator, this constructor will be invoked again.- Parameters:
iterator- theMessageHandlingMembersfrom 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:MessageHandlerInterceptorMemberChainInvokes the interceptors in this chain for the givenmessage, ultimately invoking the givenhandlerunless an interceptor short-circuits the chain.- Specified by:
handlein interfaceMessageHandlerInterceptorMemberChain<T>- Parameters:
message- the message to intercept and, ultimately, handlecontext- the context under which themessageis processedtarget- the instance declaring the interceptors and thehandler, ornullwhen there is no instance to invoke them on, in which case this chain must only containstaticmembershandler- the handler to invoke once every interceptor has proceeded the chain- Returns:
- a stream containing the result of handling the
message
-