Package org.axonframework.modelling.saga
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 thisMessageHandlingMember
- 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 Summary
ConstructorsModifierConstructorDescriptionprotectedEndSageMessageHandlingMember(MessageHandlingMember<T> delegate) Initializes the member using the givendelegate. -
Method Summary
Modifier and TypeMethodDescriptionhandle(Message message, ProcessingContext context, @Nullable T target) Handles the givenmessagewithin the givencontextby invoking the appropriate method on giventarget.Methods inherited from class org.axonframework.messaging.core.annotation.WrappedMessageHandlingMember
attribute, canHandle, canHandleMessageType, canHandleType, 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.core.annotation.MessageHandlingMember
declaringClass, signature
-
Constructor Details
-
EndSageMessageHandlingMember
Initializes the member using the givendelegate.- Parameters:
delegate- the actual message handling member to delegate to
-
-
Method Details
-
handle
Description copied from interface:MessageHandlingMemberHandles the givenmessagewithin the givencontextby 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. These exceptions should be caught and passed along in a
failed MessageStream.- Specified by:
handlein interfaceMessageHandlingMember<T>- Overrides:
handlein classWrappedMessageHandlingMember<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
MessageStreamcontaining the response(s), if any, from handling the givenmessage.
-