public class SimpleSagaManager extends AbstractSagaManager
setEventsToAlwaysCreateNewSagasFor(java.util.List) and setEventsToOptionallyCreateNewSagasFor(java.util.List).| Constructor and Description |
|---|
SimpleSagaManager(Class<? extends Saga> sagaType,
SagaRepository sagaRepository,
AssociationValueResolver associationValueResolver,
EventBus eventBus)
Initialize a SimpleSagaManager backed by the given resources, using a GenericSagaFactory.
|
SimpleSagaManager(Class<? extends Saga> sagaType,
SagaRepository sagaRepository,
AssociationValueResolver associationValueResolver,
SagaFactory sagaFactory,
EventBus eventBus)
Initialize a SimpleSagaManager backed by the given resources.
|
| Modifier and Type | Method and Description |
|---|---|
protected AssociationValue |
extractAssociationValue(Class<? extends Saga> type,
EventMessage event)
Extracts the AssociationValue from the given
event as relevant for a Saga of given
sagaType. |
protected SagaCreationPolicy |
getSagaCreationPolicy(Class<? extends Saga> type,
EventMessage event)
Returns the Saga Creation Policy for a Saga of the given
sagaType and event. |
Class<?> |
getTargetType()
Returns the instance type that this proxy delegates all event handling to.
|
void |
setEventsToAlwaysCreateNewSagasFor(List<Class<?>> events)
Sets the types of Events that should cause the creation of a new Saga instance, even if one already exists.
|
void |
setEventsToOptionallyCreateNewSagasFor(List<Class<?>> events)
Sets the types of Events that should cause the creation of a new Saga instance if one does not already exist.
|
commit, handle, setSuppressExceptions, setSynchronizeSagaAccess, subscribe, unsubscribepublic SimpleSagaManager(Class<? extends Saga> sagaType, SagaRepository sagaRepository, AssociationValueResolver associationValueResolver, EventBus eventBus)
sagaType - The type of Saga managed by this SagaManagersagaRepository - The repository providing access to Saga instancesassociationValueResolver - The instance providing AssociationValues for incoming EventseventBus - The event bus that the manager should register topublic SimpleSagaManager(Class<? extends Saga> sagaType, SagaRepository sagaRepository, AssociationValueResolver associationValueResolver, SagaFactory sagaFactory, EventBus eventBus)
sagaType - The type of Saga managed by this SagaManagersagaRepository - The repository providing access to Saga instancesassociationValueResolver - The instance providing AssociationValues for incoming EventssagaFactory - The factory creating new Saga instanceseventBus - The event bus that the manager should register toprotected SagaCreationPolicy getSagaCreationPolicy(Class<? extends Saga> type, EventMessage event)
AbstractSagaManagersagaType and event.getSagaCreationPolicy in class AbstractSagaManagertype - The type of Saga to get the creation policy forevent - The Event that is being dispatched to Saga instancesprotected AssociationValue extractAssociationValue(Class<? extends Saga> type, EventMessage event)
AbstractSagaManagerevent as relevant for a Saga of given
sagaType.extractAssociationValue in class AbstractSagaManagertype - The type of Saga about to handle the Eventevent - The event containing the association informationpublic void setEventsToAlwaysCreateNewSagasFor(List<Class<?>> events)
events - the types of Events that should cause the creation of a new Saga instance, even if one already
existspublic void setEventsToOptionallyCreateNewSagasFor(List<Class<?>> events)
events - the types of Events that should cause the creation of a new Saga instance if one does not already
existpublic Class<?> getTargetType()
EventListenerProxyCopyright © 2010-2013. All Rights Reserved.