public class SagaMethodMessageHandler extends Object implements Comparable<SagaMethodMessageHandler>
SagaEventHandler
annotated methods.Modifier | Constructor and Description |
---|---|
protected |
SagaMethodMessageHandler(SagaCreationPolicy creationPolicy,
MethodMessageHandler handler,
String associationKey,
Property associationProperty)
Creates a SagaMethodMessageHandler.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(SagaMethodMessageHandler o) |
boolean |
equals(Object o) |
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.
|
static SagaMethodMessageHandler |
getInstance(MethodMessageHandler methodHandler)
Create a SagaMethodMessageHandler for the given
methodHandler . |
int |
hashCode() |
boolean |
isHandlerAvailable()
Indicates whether the inspected method is an Event Handler.
|
boolean |
matches(EventMessage message)
Indicates whether this Handler is suitable for the given
message . |
static SagaMethodMessageHandler |
noHandler()
Returns a SagaMethodMessageHandler indicating that a inspected method is *not* a SagaEventHandler.
|
protected SagaMethodMessageHandler(SagaCreationPolicy creationPolicy, MethodMessageHandler handler, String associationKey, Property associationProperty)
creationPolicy
- The creation policy for the handlerMethodhandler
- The handler for the eventassociationKey
- The association key configured for this handlerassociationProperty
- The association property configured for this handlerpublic static SagaMethodMessageHandler noHandler()
public static SagaMethodMessageHandler getInstance(MethodMessageHandler methodHandler)
methodHandler
. The SagaMethodMessageHandler add
information specific to the behavior of Sagas, such as the association value and creation policy.methodHandler
- The handler for incoming eventspublic boolean isHandlerAvailable()
public 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 SagaCreationPolicy getCreationPolicy()
public boolean matches(EventMessage message)
message
.message
- The message to inspecttrue
if this handler can handle the message, otherwise false
.public int compareTo(SagaMethodMessageHandler o)
compareTo
in interface Comparable<SagaMethodMessageHandler>
Copyright © 2010-2013. All Rights Reserved.