Class EndSagaMessageHandlerDefinition.EndSageMessageHandlingMember<T>

java.lang.Object
org.axonframework.messaging.core.annotation.WrappedMessageHandlingMember<T>
org.axonframework.modelling.saga.EndSagaMessageHandlerDefinition.EndSageMessageHandlingMember<T>
Type Parameters:
T - the entity type wrapped by this MessageHandlingMember
All Implemented Interfaces:
MessageHandlingMember<T>
Enclosing class:
EndSagaMessageHandlerDefinition

public static class EndSagaMessageHandlerDefinition.EndSageMessageHandlingMember<T> extends WrappedMessageHandlingMember<T>
A WrappedMessageHandlingMember implementation dedicated towards MessageHandlingMembers annotated with EndSaga. After invocation of the handle(Message, ProcessingContext, Object) method, the saga is ended through the SagaLifecycle.end() method, whether the handler succeeded or failed: Axon Framework 4 called SagaLifecycle.end() in a finally block, so a throwing @EndSaga handler ended its saga all the same.
  • Constructor Details

    • EndSageMessageHandlingMember

      protected EndSageMessageHandlingMember(MessageHandlingMember<T> delegate)
      Initializes the member using the given delegate.
      Parameters:
      delegate - the actual message handling member to delegate to
  • Method Details

    • handle

      public MessageStream<?> handle(Message message, ProcessingContext context, @Nullable T target)
      Description copied from interface: MessageHandlingMember
      Handles the given message within the given context 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. These exceptions should be caught and passed along in a failed MessageStream.

      Specified by:
      handle in interface MessageHandlingMember<T>
      Overrides:
      handle in class WrappedMessageHandlingMember<T>
      Parameters:
      message - The message to handle.
      context - The context in which the message is being handled.
      target - The target to handle the message.
      Returns:
      The MessageStream containing the response(s), if any, from handling the given message.