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)
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 . |
annotationAttributes, attribute, canHandle, canHandleMessageType, canHandleType, hasAnnotation, payloadType, priority, unwrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
declaringClass, signature
public SagaMethodMessageHandlingMember(MessageHandlingMember<T> delegate, SagaCreationPolicy creationPolicy, String associationKey, String associationPropertyName, AssociationResolver associationResolver)
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 handlerpublic 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(@Nonnull 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()
Copyright © 2010–2024. All rights reserved.