public class SagaMethodMessageHandlingMember<T> extends WrappedMessageHandlingMember<T>
SagaEventHandler
annotated methods.Constructor and Description |
---|
SagaMethodMessageHandlingMember(MessageHandlingMember<T> delegate,
SagaCreationPolicy creationPolicy,
String associationKey,
String associationPropertyName,
AssociationResolver associationResolver,
boolean endingHandler)
Creates a SagaMethodMessageHandler.
|
Modifier and Type | Method and Description |
---|---|
AssociationValue |
getAssociationValue(EventMessage<?> eventMessage)
The AssociationValue to find the saga instance with, or
null if no AssociationValue can be found on
the given eventMessage . |
SagaCreationPolicy |
getCreationPolicy()
Returns the creation policy of the inspected method.
|
Object |
handle(Message<?> message,
T target)
Handles the given
message by invoking the appropriate method on given target . |
boolean |
isEndingHandler()
Indicates whether this handler is one that ends the Saga lifecycle
|
annotationAttributes, canHandle, hasAnnotation, payloadType, priority, unwrap
public SagaMethodMessageHandlingMember(MessageHandlingMember<T> delegate, SagaCreationPolicy creationPolicy, String associationKey, String associationPropertyName, AssociationResolver associationResolver, boolean endingHandler)
creationPolicy
- The creation policy for the handlerMethoddelegate
- The message handler for the eventassociationKey
- The association key configured for this handlerassociationPropertyName
- The association property name to look up in the messageassociationResolver
- The association resolver configured for this handlerendingHandler
- Flag to indicate if an invocation of the given handler should end the sagapublic AssociationValue getAssociationValue(EventMessage<?> eventMessage)
null
if no AssociationValue can be found on
the given eventMessage
.eventMessage
- The event message containing the value of the associationnull
if none foundpublic Object handle(Message<?> message, T target) throws Exception
MessageHandlingMember
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.handle
in interface MessageHandlingMember<T>
handle
in class WrappedMessageHandlingMember<T>
message
- The message to handletarget
- The target to handle the messageException
- when there was a problem that prevented invocation of the method or if an exception was thrown
from the invoked methodpublic SagaCreationPolicy getCreationPolicy()
public boolean isEndingHandler()
true
if the Saga lifecycle ends unconditionally after this call, otherwise
false
Copyright © 2010–2018. All rights reserved.