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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAttribute key referencing an aggregate creation policy to be used when handling a command.static final StringAttribute key referencing whether the handler is allowed to be invoked on replays.static final StringAttribute key referencing the name of theCommandMessagethe handler can handle.static final StringAttribute key reference the command name pattern for a command message interceptor.static final StringAttribute key referencing the routing key used to route aCommandMessageto the handler.static final StringAttribute key referencing the name of thethe handler can handle.invalid reference
org.axonframework.deadline.DeadlineMessagestatic final StringAttribute key referencing the name of theEventMessagethe handler can handle.static final StringAttribute key referencing the exception result type the handler can handle.static final StringAttribute key referencing whether the handler forces the creation of a new saga instance.static final StringAttribute key referencing theMessagetype being handled by the handler.static final StringAttribute key referencing the payload type contained in theMessage.static final StringAttribute key referencing the name of theQueryMessagethe handler can handle.static final StringAttribute key referencing the result type the handler can handle.static final StringAttribute key referencing the property in the handledEventMessageto associate a saga instance with.static final StringAttribute key referencing the saga event handler's association property key name used.static final StringAttribute key referencing the type of association resolver used by a saga event handler. -
Method Summary
Modifier and TypeMethodDescriptionbooleanValidates whether the givenattributeKeyis present in this object.<R> RRetrieve the attribute for the givenattributeKey.getAll()Retrieve all attributes stored in thisHandlerAttributesobject.booleanisEmpty()Validate whether zero attributes are present in this object.mergedWith(HandlerAttributes other) Returns aHandlerAttributes, merging the attributes inthisinstance with the givenattributes.
-
Field Details
-
MESSAGE_TYPE
Attribute key referencing theMessagetype being handled by the handler.- See Also:
-
PAYLOAD_TYPE
Attribute key referencing the payload type contained in theMessage.- See Also:
-
COMMAND_NAME
Attribute key referencing the name of theCommandMessagethe handler can handle.- See Also:
-
COMMAND_ROUTING_KEY
Attribute key referencing the routing key used to route aCommandMessageto the handler.- See Also:
-
QUERY_NAME
Attribute key referencing the name of theQueryMessagethe handler can handle.- See Also:
-
EVENT_NAME
Attribute key referencing the name of theEventMessagethe handler can handle.- See Also:
-
RESULT_TYPE
Attribute key referencing the result type the handler can handle.- See Also:
-
EXCEPTION_RESULT_TYPE
Attribute key referencing the exception result type the handler can handle.- See Also:
-
COMMAND_NAME_PATTERN
Attribute key reference the command name pattern for a command message interceptor.- See Also:
-
FORCE_NEW_SAGA
Attribute key referencing whether the handler forces the creation of a new saga instance.- See Also:
-
SAGA_ASSOCIATION_PROPERTY
Attribute key referencing the property in the handledEventMessageto associate a saga instance with.- See Also:
-
SAGA_ASSOCIATION_PROPERTY_KEY_NAME
Attribute key referencing the saga event handler's association property key name used.- See Also:
-
SAGA_ASSOCIATION_RESOLVER
Attribute key referencing the type of association resolver used by a saga event handler.- See Also:
-
AGGREGATE_CREATION_POLICY
Attribute key referencing an aggregate creation policy to be used when handling a command.- See Also:
-
ALLOW_REPLAY
Attribute key referencing whether the handler is allowed to be invoked on replays.- See Also:
-
DEADLINE_NAME
Attribute key referencing the name of thethe handler can handle.invalid reference
org.axonframework.deadline.DeadlineMessage- See Also:
-
-
Method Details
-
get
Retrieve the attribute for the givenattributeKey. Might benullif 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
Retrieve all attributes stored in thisHandlerAttributesobject.- Returns:
- all attributes stored in this
HandlerAttributesobject
-
contains
Validates whether the givenattributeKeyis present in this object.- Parameters:
attributeKey- the attribute key to validate if it is present in this object- Returns:
trueif there is an attribute for the givenattributeKeypresent,falseotherwise
-
isEmpty
boolean isEmpty()Validate whether zero attributes are present in this object.- Returns:
trueif there are no attributes present,falseotherwise
-
mergedWith
Returns aHandlerAttributes, merging the attributes inthisinstance with the givenattributes. Ifthisandotherhave identical entries, the values fromotherwill take precedence.- Parameters:
other- TheHandlerAttributesto group withthisinstance's attributes.- Returns:
- A
HandlerAttributescombiningthisinstance's attributes and the givenotherattributes.
-