Package org.axonframework.modelling.saga
Class SagaMethodMessageHandlingMember<T>
java.lang.Object
org.axonframework.messaging.annotation.WrappedMessageHandlingMember<T>
org.axonframework.modelling.saga.SagaMethodMessageHandlingMember<T>
- All Implemented Interfaces:
MessageHandlingMember<T>
A data holder containing information of
SagaEventHandler annotated methods.- Since:
- 2.0
- Author:
- Allard Buijze, Sofia Guy Ang
-
Constructor Summary
ConstructorsConstructorDescriptionSagaMethodMessageHandlingMember(MessageHandlingMember<T> delegate, SagaCreationPolicy creationPolicy, String associationKey, String associationPropertyName, AssociationResolver associationResolver) Creates a SagaMethodMessageHandler. -
Method Summary
Modifier and TypeMethodDescriptiongetAssociationValue(EventMessage<?> eventMessage) The AssociationValue to find the saga instance with, ornullif no AssociationValue can be found on the giveneventMessage.Returns the creation policy of the inspected method.Handles the givenmessageby invoking the appropriate method on giventarget.Methods inherited from class org.axonframework.messaging.annotation.WrappedMessageHandlingMember
annotationAttributes, attribute, canHandle, canHandleMessageType, canHandleType, hasAnnotation, payloadType, priority, unwrapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.messaging.annotation.MessageHandlingMember
declaringClass, signature
-
Constructor Details
-
SagaMethodMessageHandlingMember
public SagaMethodMessageHandlingMember(MessageHandlingMember<T> delegate, SagaCreationPolicy creationPolicy, String associationKey, String associationPropertyName, AssociationResolver associationResolver) Creates a SagaMethodMessageHandler.- Parameters:
delegate- The message handler for the eventcreationPolicy- The creation policy for the handlerMethodassociationKey- The association key configured for this handlerassociationPropertyName- The association property name to look up in the messageassociationResolver- The association resolver configured for this handler
-
-
Method Details
-
getAssociationValue
The AssociationValue to find the saga instance with, ornullif no AssociationValue can be found on the giveneventMessage.- Parameters:
eventMessage- The event message containing the value of the association- Returns:
- the AssociationValue to find the saga instance with, or
nullif none found
-
handle
Description copied from interface:MessageHandlingMemberHandles the givenmessageby invoking the appropriate method on giventarget. This may result in an exception if the given target is not capable of handling the message or if an exception is thrown during invocation of the method.- Specified by:
handlein interfaceMessageHandlingMember<T>- Overrides:
handlein classWrappedMessageHandlingMember<T>- Parameters:
message- The message to handletarget- The target to handle the message- Returns:
- The message handling result in case the invocation was successful
- Throws:
Exception- when there was a problem that prevented invocation of the method or if an exception was thrown from the invoked method
-
getCreationPolicy
Returns the creation policy of the inspected method.- Returns:
- the creation policy of the inspected method
-