T
- The type that declares the handlers in this chain.public class ChainedMessageHandlerInterceptorMember<T> extends Object implements MessageHandlerInterceptorMemberChain<T>
MessageHandlerInterceptorMemberChain
implementation that constructs a chain of instances of itself based on
a given iterator
of MessageHandlingMembers
.Constructor and Description |
---|
ChainedMessageHandlerInterceptorMember(Class<?> handlerType,
Iterator<MessageHandlingMember<? super T>> iterator)
Constructs a chained message handling interceptor for the given
handlerType , constructing a chain from
the given iterator . |
Modifier and Type | Method and Description |
---|---|
Object |
handle(Message<?> message,
T target,
MessageHandlingMember<? super T> handler)
Handle the given
message by passing it through the interceptors and ultimately to the given
handler on the given target instance. |
public ChainedMessageHandlerInterceptorMember(Class<?> handlerType, Iterator<MessageHandlingMember<? super T>> iterator)
handlerType
, constructing a chain from
the given iterator
.
The iterator
should at least> have a single MessageHandlingMember
. If there are more
MessageHandlingMembers
present in the given iterator
, this constructor will be invoked again.
handlerType
- The type for which to construct a message handler interceptor chain.iterator
- The MessageHandlingMembers
from which to construct the chain.public Object handle(@Nonnull Message<?> message, @Nonnull T target, @Nonnull MessageHandlingMember<? super T> handler) throws Exception
MessageHandlerInterceptorMemberChain
message
by passing it through the interceptors and ultimately to the given
handler
on the given target
instance. The result of this invocation is the result as given by the
handler
, possibly modified by any of the interceptors in this chain.handle
in interface MessageHandlerInterceptorMemberChain<T>
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 messageException
- any exception thrown by the handler or any of the interceptorsCopyright © 2010–2025. All rights reserved.