Class SagaMethodMessageHandlingMember<T>

java.lang.Object
org.axonframework.messaging.annotation.WrappedMessageHandlingMember<T>
org.axonframework.modelling.saga.SagaMethodMessageHandlingMember<T>
All Implemented Interfaces:
MessageHandlingMember<T>

public class SagaMethodMessageHandlingMember<T> extends WrappedMessageHandlingMember<T>
A data holder containing information of SagaEventHandler annotated methods.
Since:
2.0
Author:
Allard Buijze, Sofia Guy Ang
  • 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 event
      creationPolicy - The creation policy for the handlerMethod
      associationKey - The association key configured for this handler
      associationPropertyName - The association property name to look up in the message
      associationResolver - The association resolver configured for this handler
  • Method Details

    • getAssociationValue

      public AssociationValue getAssociationValue(EventMessage<?> eventMessage)
      The AssociationValue to find the saga instance with, or null if no AssociationValue can be found on the given eventMessage.
      Parameters:
      eventMessage - The event message containing the value of the association
      Returns:
      the AssociationValue to find the saga instance with, or null if none found
    • handle

      public Object handle(@Nonnull Message<?> message, T target) throws Exception
      Description copied from interface: MessageHandlingMember
      Handles the given message by invoking the appropriate method on given target. 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:
      handle in interface MessageHandlingMember<T>
      Overrides:
      handle in class WrappedMessageHandlingMember<T>
      Parameters:
      message - The message to handle
      target - 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

      public SagaCreationPolicy getCreationPolicy()
      Returns the creation policy of the inspected method.
      Returns:
      the creation policy of the inspected method