Interface HandlerAttributes

All Known Implementing Classes:
AnnotatedHandlerAttributes, SimpleHandlerAttributes

public interface HandlerAttributes
Container for message handler attributes. Typically used by MessageHandlingMember implementations. Stores handler attributes in a Map of String to Object. Some default keys used by HandlerAttributes implementations, like MESSAGE_TYPE can be used to get(String) entries.
Since:
4.5.0
Author:
Steven van Beelen
  • Field Details

    • MESSAGE_TYPE

      static final String MESSAGE_TYPE
      Attribute key referencing the Message type being handled by the handler.
      See Also:
    • PAYLOAD_TYPE

      static final String PAYLOAD_TYPE
      Attribute key referencing the payload type contained in the Message.
      See Also:
    • COMMAND_NAME

      static final String COMMAND_NAME
      Attribute key referencing the name of the CommandMessage the handler can handle.
      See Also:
    • COMMAND_ROUTING_KEY

      static final String COMMAND_ROUTING_KEY
      Attribute key referencing the routing key used to route a CommandMessage to the handler.
      See Also:
    • QUERY_NAME

      static final String QUERY_NAME
      Attribute key referencing the name of the QueryMessage the handler can handle.
      See Also:
    • EVENT_NAME

      static final String EVENT_NAME
      Attribute key referencing the name of the EventMessage the handler can handle.
      See Also:
    • RESULT_TYPE

      static final String RESULT_TYPE
      Attribute key referencing the result type the handler can handle.
      See Also:
    • EXCEPTION_RESULT_TYPE

      static final String EXCEPTION_RESULT_TYPE
      Attribute key referencing the exception result type the handler can handle.
      See Also:
    • COMMAND_NAME_PATTERN

      static final String COMMAND_NAME_PATTERN
      Attribute key reference the command name pattern for a command message interceptor.
      See Also:
    • FORCE_NEW_SAGA

      static final String FORCE_NEW_SAGA
      Attribute key referencing whether the handler forces the creation of a new saga instance.
      See Also:
    • SAGA_ASSOCIATION_PROPERTY

      static final String SAGA_ASSOCIATION_PROPERTY
      Attribute key referencing the property in the handled EventMessage to associate a saga instance with.
      See Also:
    • SAGA_ASSOCIATION_PROPERTY_KEY_NAME

      static final String SAGA_ASSOCIATION_PROPERTY_KEY_NAME
      Attribute key referencing the saga event handler's association property key name used.
      See Also:
    • SAGA_ASSOCIATION_RESOLVER

      static final String SAGA_ASSOCIATION_RESOLVER
      Attribute key referencing the type of association resolver used by a saga event handler.
      See Also:
    • AGGREGATE_CREATION_POLICY

      static final String AGGREGATE_CREATION_POLICY
      Attribute key referencing an aggregate creation policy to be used when handling a command.
      See Also:
    • ALLOW_REPLAY

      static final String ALLOW_REPLAY
      Attribute key referencing whether the handler is allowed to be invoked on replays.
      See Also:
    • DEADLINE_NAME

      static final String DEADLINE_NAME
      Attribute key referencing the name of the
      invalid reference
      org.axonframework.deadline.DeadlineMessage
      the handler can handle.
      See Also:
  • Method Details

    • get

      <R> R get(String attributeKey)
      Retrieve the attribute for the given attributeKey. Might be null if there is no attribute present for the given key.
      Type Parameters:
      R - the type of attribute to retrieve
      Parameters:
      attributeKey - the attribute key to retrieve an attribute for
      Returns:
      the attribute for the given attributeKey
    • getAll

      Map<String,Object> getAll()
      Retrieve all attributes stored in this HandlerAttributes object.
      Returns:
      all attributes stored in this HandlerAttributes object
    • contains

      boolean contains(String attributeKey)
      Validates whether the given attributeKey is present in this object.
      Parameters:
      attributeKey - the attribute key to validate if it is present in this object
      Returns:
      true if there is an attribute for the given attributeKey present, false otherwise
    • isEmpty

      boolean isEmpty()
      Validate whether zero attributes are present in this object.
      Returns:
      true if there are no attributes present, false otherwise
    • mergedWith

      Returns a HandlerAttributes, merging the attributes in this instance with the given attributes. If this and other have identical entries, the values from other will take precedence.
      Parameters:
      other - The HandlerAttributes to group with this instance's attributes.
      Returns:
      A HandlerAttributes combining this instance's attributes and the given other attributes.