|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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,
Class<? extends Annotation> annotationType,
boolean allowDuplicates)
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,
Class<? extends Annotation> annotationType,
boolean allowDuplicates)
target object that has handler method annotated with
given annotationType.
target - The target to invoke methods onannotationType - The type of annotation used to demarcate the handler methodsallowDuplicates - Whether or not to accept multiple handlers listening to messages with the same payload
type| Method Detail |
|---|
public Object invokeHandlerMethod(Message parameter)
throws InvocationTargetException,
IllegalAccessException
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
IllegalAccessException - when the security manager does not allow the invocation
InvocationTargetException - when the handler throws a checked Exceptionpublic 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 | |||||||||