|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.common.annotation.AbstractMessageHandler org.axonframework.common.annotation.MethodMessageHandler
public final class MethodMessageHandler
Represents a method recognized as a handler by the handler inspector (see MethodMessageHandlerInspector
).
Method Summary | ||
---|---|---|
static MethodMessageHandler |
createFor(Method method,
Class<?> explicitPayloadType,
ParameterResolverFactory parameterResolverFactory)
Creates a MethodMessageHandler for the given method , using given explicitPayloadType
(if not null ) defining the payload of the message it supports. |
|
boolean |
equals(Object o)
|
|
|
getAnnotation(Class<T> annotationType)
Returns the member-level annotation of given annotationType , or null if no such
annotation is present. |
|
Method |
getMethod()
Returns the Method backing this handler. |
|
String |
getMethodName()
Returns the name of the method backing this handler. |
|
int |
hashCode()
|
|
Object |
invoke(Object target,
Message message)
Invokes this handler for the given target instance, using the given message as
source object to provide parameter values. |
|
String |
toString()
|
Methods inherited from class org.axonframework.common.annotation.AbstractMessageHandler |
---|
compareTo, findResolvers, getParameterValueResolvers, getPayloadType, matches |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static MethodMessageHandler createFor(Method method, Class<?> explicitPayloadType, ParameterResolverFactory parameterResolverFactory)
method
, using given explicitPayloadType
(if not null
) defining the payload of the message it supports. If null
, the payload
type is deducted from the first parameter of the method.
method
- The method to create a Handler forexplicitPayloadType
- The payload type explicitly defined on the method, or null
parameterResolverFactory
- The strategy for resolving parameter values of handler methods
UnsupportedHandlerException
- if the given method is not suitable as a Handlerpublic Object invoke(Object target, Message message) throws InvocationTargetException, IllegalAccessException
AbstractMessageHandler
target
instance, using the given message
as
source object to provide parameter values.
invoke
in class AbstractMessageHandler
target
- The target instance to invoke the Handler on.message
- The message providing parameter values
InvocationTargetException
- when the handler throws a checked exception
IllegalAccessException
- if the SecurityManager refuses the handler invocationpublic <T extends Annotation> T getAnnotation(Class<T> annotationType)
AbstractMessageHandler
annotationType
, or null
if no such
annotation is present.
getAnnotation
in class AbstractMessageHandler
T
- The type of annotation to retrieveannotationType
- The type of annotation to retrieve
null
if no such annotation is present.public String getMethodName()
public Method getMethod()
public String toString()
toString
in class Object
public boolean equals(Object o)
equals
in class AbstractMessageHandler
public int hashCode()
hashCode
in class AbstractMessageHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |