|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.saga.annotation.SagaMethodMessageHandler
public class SagaMethodMessageHandler
A data holder containing information of SagaEventHandler
annotated methods.
Constructor Summary | |
---|---|
protected |
SagaMethodMessageHandler(SagaCreationPolicy creationPolicy,
MethodMessageHandler handler,
String associationKey,
String associationPropertyName,
Property associationProperty)
Creates a SagaMethodMessageHandler. |
Method Summary | |
---|---|
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 . |
String |
getName()
Returns the name of the handler. |
int |
hashCode()
|
void |
invoke(Object target,
EventMessage message)
Invoke a handler on given target for given message . |
boolean |
isEndingHandler()
Indicates whether this handler is one that ends the Saga lifecycle |
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. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected SagaMethodMessageHandler(SagaCreationPolicy creationPolicy, MethodMessageHandler handler, String associationKey, String associationPropertyName, 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 handlerMethod Detail |
---|
public 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 events
public 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 association
null
if none foundpublic SagaCreationPolicy getCreationPolicy()
public boolean matches(EventMessage message)
message
.
message
- The message to inspect
true
if this handler can handle the message, otherwise false
.public boolean isEndingHandler()
true
if the Saga lifecycle ends unconditionally after this call, otherwise
false
public int compareTo(SagaMethodMessageHandler o)
compareTo
in interface Comparable<SagaMethodMessageHandler>
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public void invoke(Object target, EventMessage message)
target
for given message
.
target
- The instance to invoke a method onmessage
- The message to use to resolve the parameters of the handler to invokepublic String getName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |