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)
Creates a ConstructorCommandMessageHandler for the given
constructor . |
<T extends Annotation> |
getAnnotation(Class<T> 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, matches
public static <T extends AggregateRoot> ConstructorCommandMessageHandler<T> forConstructor(Constructor<T> constructor)
constructor
.T
- The type of Aggregate created by the constructorconstructor
- The constructor to wrap as a HandlerUnsupportedHandlerException
- when the given constructor is not suitable as a Handlerpublic T 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 valuesInvocationTargetException
- when the handler throws a checked exceptionIllegalAccessException
- 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 retrievenull
if no such annotation is present.Copyright © 2010-2013. All Rights Reserved.