Package org.axonframework.messaging.core
Class DefaultMessageDispatchInterceptorChain<M extends Message>
java.lang.Object
org.axonframework.messaging.core.DefaultMessageDispatchInterceptorChain<M>
- Type Parameters:
M- The type ofMessageintercepted by this chain.
- All Implemented Interfaces:
MessageDispatchInterceptorChain<M>
@Internal
public class DefaultMessageDispatchInterceptorChain<M extends Message>
extends Object
implements MessageDispatchInterceptorChain<M>
Default implementation for a
MessageDispatchInterceptorChain.- Since:
- 5.0.0
- Author:
- Allard Buijze, Simon Zambrovski, Steven van Beelen
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultMessageDispatchInterceptorChain(Collection<MessageDispatchInterceptor<? super M>> interceptors) Constructs aDefaultMessageDispatchInterceptorChainfrom the giveninterceptorswithout a terminal operation once the end of the interceptor chain has been reached.DefaultMessageDispatchInterceptorChain(Collection<MessageDispatchInterceptor<? super M>> interceptors, BiFunction<? super M, ProcessingContext, MessageStream<?>> terminal) Constructs aDefaultMessageDispatchInterceptorChainfrom the giveninterceptors, invoking the giventerminaloperation when reaching the end of the interceptor chain. -
Method Summary
Modifier and TypeMethodDescriptionproceed(M message, ProcessingContext context) Signals this interceptor chain to continue processing themessage.
-
Constructor Details
-
DefaultMessageDispatchInterceptorChain
public DefaultMessageDispatchInterceptorChain(@Nonnull Collection<MessageDispatchInterceptor<? super M>> interceptors) Constructs aDefaultMessageDispatchInterceptorChainfrom the giveninterceptorswithout a terminal operation once the end of the interceptor chain has been reached.- Parameters:
interceptors- The list of dispatch interceptors that are part of this chain.
-
DefaultMessageDispatchInterceptorChain
public DefaultMessageDispatchInterceptorChain(@Nonnull Collection<MessageDispatchInterceptor<? super M>> interceptors, @Nonnull BiFunction<? super M, ProcessingContext, MessageStream<?>> terminal) Constructs aDefaultMessageDispatchInterceptorChainfrom the giveninterceptors, invoking the giventerminaloperation when reaching the end of the interceptor chain.- Parameters:
interceptors- The list of dispatch interceptors that are part of this chain.terminal- function to be invoked after the chain processing.
-
-
Method Details
-
proceed
Description copied from interface:MessageDispatchInterceptorChainSignals this interceptor chain to continue processing themessage.- Specified by:
proceedin interfaceMessageDispatchInterceptorChain<M extends Message>- Parameters:
message- The message to pass down the chain.context- The active processing context, if any. Can be used to (e.g.) validate correlation data.- Returns:
- A
MessageStreamcontaining the result of processing the givenmessage.
-