public class SerializationOptimizingInterceptor extends Object implements CommandHandlerInterceptor
Constructor and Description |
---|
SerializationOptimizingInterceptor() |
Modifier and Type | Method and Description |
---|---|
Object |
handle(CommandMessage<?> commandMessage,
UnitOfWork unitOfWork,
InterceptorChain interceptorChain)
The handle method is invoked each time a command is dispatched through the command bus that the
CommandHandlerInterceptor is declared on.
|
public Object handle(CommandMessage<?> commandMessage, UnitOfWork unitOfWork, InterceptorChain interceptorChain) throws Throwable
CommandHandlerInterceptor
unitOfWork
.
The interceptor is responsible for the continuation of the dispatch process by invoking the InterceptorChain.proceed(CommandMessage)
method on the given
interceptorChain
.
Any information gathered by interceptors may be attached to the unitOfWork. This information is made
available to the CommandCallback provided by the dispatching component.
Interceptors are highly recommended not to change the type of the command handling result, as the dispatching
component might expect a result of a specific type.handle
in interface CommandHandlerInterceptor
commandMessage
- The command being dispatchedunitOfWork
- The UnitOfWork in whichinterceptorChain
- The interceptor chain that allows this interceptor to proceed the dispatch processThrowable
- any exception that occurs while handling the commandCopyright © 2010-2014. All Rights Reserved.