Class AnnotatedMessageHandlingMemberDefinition

java.lang.Object
org.axonframework.messaging.annotation.AnnotatedMessageHandlingMemberDefinition
All Implemented Interfaces:
HandlerDefinition

public class AnnotatedMessageHandlingMemberDefinition extends Object implements 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 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: HandlerDefinition
      Create a MessageHandlingMember for the given executable method. Use the given parameterResolverFactory to resolve the method's parameters.
      Specified by:
      createHandler in interface HandlerDefinition
      Type Parameters:
      T - The type of the declaring object
      Parameters:
      declaringType - The type of object declaring the given executable method
      executable - The method to inspect
      parameterResolverFactory - Factory for a ParameterResolver of the method
      Returns:
      An optional containing the handler if the method is suitable, or an empty Nullable otherwise