T - the type of aggregate this handler handles commands forpublic final class ConstructorCommandMessageHandler<T extends AggregateRoot> extends AbstractMessageHandler
| Modifier and Type | Method and Description |
|---|---|
static <T extends AggregateRoot> |
forConstructor(Constructor<T> constructor,
ParameterResolverFactory parameterResolverFactory)
Creates a ConstructorCommandMessageHandler for the given
constructor. |
<A extends Annotation> |
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. |
compareTo, equals, findResolvers, getParameterValueResolvers, getPayloadType, hashCode, matchespublic 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 methodsUnsupportedHandlerException - when the given constructor is not suitable as a Handlerpublic 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 valuesInvocationTargetException - when the handler throws a checked exceptionIllegalAccessException - 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 retrievenull if no such annotation is present.Copyright © 2010-2014. All Rights Reserved.