|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.common.annotation.MessageHandlerInvoker
public final class MessageHandlerInvoker
Abstract class to support implementations that need to invoke methods based on an annotation.
Constructor Summary | |
---|---|
MessageHandlerInvoker(Object target,
ParameterResolverFactory parameterResolverFactory,
boolean allowDuplicates,
HandlerDefinition<? super Method> handlerDefinition)
Initialize a handler invoker for the given target object that has handler method annotated with
given annotationType . |
Method Summary | |
---|---|
MethodMessageHandler |
findHandlerMethod(Message message)
Finds the handler method that can handle the given message , or null if no such handler
exists. |
Class |
getTargetType()
Returns the targetType on which handler methods are invoked. |
Object |
invokeHandlerMethod(Message parameter)
Invoke the handler demarcated with the given annotationClass on the target for the given
event . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MessageHandlerInvoker(Object target, ParameterResolverFactory parameterResolverFactory, boolean allowDuplicates, HandlerDefinition<? super Method> handlerDefinition)
target
object that has handler method annotated with
given annotationType
.
target
- The target to invoke methods onparameterResolverFactory
- The factory to create ParameterResolvers withallowDuplicates
- Whether or not to accept multiple message handlers with the same payload typehandlerDefinition
- The definition indicating which methods are message handlersMethod Detail |
---|
public Object invokeHandlerMethod(Message parameter)
annotationClass
on the target for the given
event
. Returns the result of the execution of the handler method, or null
if no
suitable handler was found.
parameter
- the event to handle
MessageHandlerInvocationException
- when a checked exception is thrown by the handler methodpublic MethodMessageHandler findHandlerMethod(Message message)
message
, or null
if no such handler
exists.
message
- The message to find a handler for
null
if none existspublic Class getTargetType()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |