|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.common.annotation.AbstractMessageHandler
org.axonframework.commandhandling.annotation.ConstructorCommandMessageHandler<T>
T - the type of aggregate this handler handles commands forpublic final class ConstructorCommandMessageHandler<T extends AggregateRoot>
Command Handler that creates a new aggregate instance by invoking that aggregate's constructor.
| Method Summary | ||
|---|---|---|
static
|
forConstructor(Constructor<T> constructor,
ParameterResolverFactory parameterResolverFactory)
Creates a ConstructorCommandMessageHandler for the given constructor. |
|
|
getAnnotation(Class<A> annotationType)
Returns the member-level annotation of given annotationType, or null if no such
annotation is present. |
|
T |
invoke(Object target,
Message message)
Invokes this handler for the given target instance, using the given message as
source object to provide parameter values. |
|
| Methods inherited from class org.axonframework.common.annotation.AbstractMessageHandler |
|---|
compareTo, equals, findResolvers, getParameterValueResolvers, getPayloadType, hashCode, matches |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T extends AggregateRoot> ConstructorCommandMessageHandler<T> forConstructor(Constructor<T> constructor,
ParameterResolverFactory parameterResolverFactory)
constructor.
T - The type of Aggregate created by the constructorconstructor - The constructor to wrap as a HandlerparameterResolverFactory - The strategy for resolving parameter values of handler methods
UnsupportedHandlerException - when the given constructor is not suitable as a Handler
public T invoke(Object target,
Message message)
throws InvocationTargetException,
IllegalAccessException
AbstractMessageHandlertarget instance, using the given message as
source object to provide parameter values.
invoke in class AbstractMessageHandlertarget - 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 <A extends Annotation> A getAnnotation(Class<A> annotationType)
AbstractMessageHandlerannotationType, or null if no such
annotation is present.
getAnnotation in class AbstractMessageHandlerA - The type of annotation to retrieveannotationType - The type of annotation to retrieve
null if no such annotation is present.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||