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 |
registerParameterResolverFactory(ParameterResolverFactory parameterResolverFactory)
Sets the ParameterResolverFactory for this instance to use.
|
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()
Saga
getSagaIdentifier
in interface Saga
public AssociationValues getAssociationValues()
Saga
getAssociationValues
in interface Saga
public final void handle(EventMessage event)
Saga
Implementations are highly discouraged from throwing exceptions.
protected void registerParameterResolverFactory(ParameterResolverFactory parameterResolverFactory)
parameterResolverFactory
- The parameterResolverFactory for this instance to usepublic boolean isActive()
Saga
protected 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-2014. All Rights Reserved.