Interface MessageHandlerInterceptorMemberChain<T>
- Type Parameters:
T- The type that declares the handlers in this chain
- All Known Implementing Classes:
ChainedMessageHandlerInterceptorMember,NoMoreInterceptors
public interface MessageHandlerInterceptorMemberChain<T>
Interface to interact with a MessageHandlingMember instance through a chain of interceptors, which were used to build
up this chain. Unlike regular handlers, interceptors have the ability to act on messages on their way to the regular
handler, and have the ability to block these messages.
- Since:
- 4.4
- Author:
- Allard Buijze
-
Method Summary
-
Method Details
-
handle
Object handle(@Nonnull Message<?> message, @Nonnull T target, @Nonnull MessageHandlingMember<? super T> handler) throws Exception Handle the givenmessageby passing it through the interceptors and ultimately to the givenhandleron the giventargetinstance. The result of this invocation is the result as given by thehandler, possibly modified by any of the interceptors in this chain.- Parameters:
message- The message to pass through the interceptor chaintarget- The target instance to invoke the interceptors and handlers onhandler- The actual handler to invoke once all interceptors have received the message- Returns:
- the result as returned by the handlers or interceptors
- Throws:
Exception- any exception thrown by the handler or any of the interceptors
-