Class AnnotatedMessageHandlingMemberDefinition
java.lang.Object
org.axonframework.messaging.annotation.AnnotatedMessageHandlingMemberDefinition
- All Implemented Interfaces:
HandlerDefinition
The default HandlerDefinition implementation in Axon. It implements the rules of annotated handlers used
in all the different types of handlers in Axon.
For this implementation to recognize a handler method, it should be (meta)annotated with MessageHandler. It
is recommended to meta-annotated members, and preconfigure the expected messageType. For example, and event
handler should define @MessageHandler(messageType = EventMessage.class), indicating that this handler should
only be invoked for EventMessages.
Use HandlerEnhancerDefinition to add extra behavior or information on top of handlers created by this
definition.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Optional<MessageHandlingMember<T>> createHandler(Class<T> declaringType, Executable executable, ParameterResolverFactory parameterResolverFactory) Create aMessageHandlingMemberfor the givenexecutablemethod.
-
Constructor Details
-
AnnotatedMessageHandlingMemberDefinition
public AnnotatedMessageHandlingMemberDefinition()
-
-
Method Details
-
createHandler
public <T> Optional<MessageHandlingMember<T>> createHandler(@Nonnull Class<T> declaringType, @Nonnull Executable executable, @Nonnull ParameterResolverFactory parameterResolverFactory) Description copied from interface:HandlerDefinitionCreate aMessageHandlingMemberfor the givenexecutablemethod. Use the givenparameterResolverFactoryto resolve the method's parameters.- Specified by:
createHandlerin interfaceHandlerDefinition- Type Parameters:
T- The type of the declaring object- Parameters:
declaringType- The type of object declaring the given executable methodexecutable- The method to inspectparameterResolverFactory- Factory for aParameterResolverof the method- Returns:
- An optional containing the handler if the method is suitable, or an empty Nullable otherwise
-