T
- The type of entity to which the message handler will delegate the actual handling of the messagepublic class AnnotatedCommandHandlerInterceptor<T> extends Object implements MessageHandlerInterceptor<CommandMessage<?>>
Constructor and Description |
---|
AnnotatedCommandHandlerInterceptor(MessageHandlingMember<T> delegate,
T target)
Initializes annotated command handler interceptor with delegate handler and target on which handler is to be
invoked.
|
Modifier and Type | Method and Description |
---|---|
Object |
handle(UnitOfWork<? extends CommandMessage<?>> unitOfWork,
InterceptorChain interceptorChain)
Invoked before a Message is handled by a designated
MessageHandler . |
public AnnotatedCommandHandlerInterceptor(MessageHandlingMember<T> delegate, T target)
delegate
- delegate command handler interceptortarget
- on which command handler interceptor is to be invokedpublic Object handle(@Nonnull UnitOfWork<? extends CommandMessage<?>> unitOfWork, @Nonnull InterceptorChain interceptorChain) throws Exception
MessageHandlerInterceptor
MessageHandler
.
The interceptor is responsible for the continuation of the handling process by invoking the InterceptorChain.proceed()
method on the given interceptorChain
.
The given unitOfWork
contains contextual information. Any information gathered by interceptors
may be attached to the unitOfWork.
Interceptors are highly recommended not to change the type of the message handling result, as the dispatching
component might expect a result of a specific type.handle
in interface MessageHandlerInterceptor<CommandMessage<?>>
unitOfWork
- The UnitOfWork that is processing the messageinterceptorChain
- The interceptor chain that allows this interceptor to proceed the dispatch processException
- any exception that occurs while handling the messageCopyright © 2010–2023. All rights reserved.