public abstract class AbstractAnnotatedSaga extends Object implements Saga, Serializable
interface that delegates incoming events to @SagaEventHandler annotated methods.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractAnnotatedSaga()
Initialize the saga with a random identifier.
|
protected |
AbstractAnnotatedSaga(String identifier)
Initialize the saga with the given identifier.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
associateWith(AssociationValue property)
Registers a AssociationValue with the given saga.
|
protected void |
associateWith(String key,
Number value)
Registers a AssociationValue with the given saga.
|
protected void |
associateWith(String key,
String value)
Registers a AssociationValue with the given saga.
|
protected void |
end()
Marks the saga as ended.
|
AssociationValues |
getAssociationValues()
Returns a view on the Association Values for this saga instance.
|
String |
getSagaIdentifier()
Returns the unique identifier of this saga.
|
void |
handle(EventMessage event)
Handle the given event.
|
boolean |
isActive()
Indicates whether or not this saga is active.
|
protected void |
removeAssociationWith(AssociationValue property)
Removes the given association from this Saga.
|
protected void |
removeAssociationWith(String key,
Number value)
Removes the given association from this Saga.
|
protected void |
removeAssociationWith(String key,
String value)
Removes the given association from this Saga.
|
protected AbstractAnnotatedSaga()
IdentifierFactory.generateIdentifier(), which defaults to a randomly generated UUID.protected AbstractAnnotatedSaga(String identifier)
identifier - the identifier to initialize the saga with.public String getSagaIdentifier()
SagagetSagaIdentifier in interface Sagapublic AssociationValues getAssociationValues()
SagagetAssociationValues in interface Sagapublic final void handle(EventMessage event)
Sagapublic boolean isActive()
Sagaprotected void end()
protected void associateWith(AssociationValue property)
property - The value to associate this saga with.protected void associateWith(String key, String value)
key - The key of the association value to associate this saga with.value - The value of the association value to associate this saga with.protected void associateWith(String key, Number value)
key - The key of the association value to associate this saga with.value - The value of the association value to associate this saga with.protected void removeAssociationWith(AssociationValue property)
property - the association value to remove from the saga.protected void removeAssociationWith(String key, String value)
key - The key of the association value to remove from this saga.value - The value of the association value to remove from this saga.protected void removeAssociationWith(String key, Number value)
key - The key of the association value to remove from this saga.value - The value of the association value to remove from this saga.Copyright © 2010-2013. All Rights Reserved.