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)
Initialize a SimpleSagaManager backed by the given resources, using a GenericSagaFactory.
|
SimpleSagaManager(Class<? extends Saga> sagaType,
SagaRepository sagaRepository,
AssociationValueResolver associationValueResolver,
EventBus eventBus)
Deprecated.
|
SimpleSagaManager(Class<? extends Saga> sagaType,
SagaRepository sagaRepository,
AssociationValueResolver associationValueResolver,
SagaFactory sagaFactory)
Initialize a SimpleSagaManager backed by the given resources.
|
SimpleSagaManager(Class<? extends Saga> sagaType,
SagaRepository sagaRepository,
AssociationValueResolver associationValueResolver,
SagaFactory sagaFactory,
EventBus eventBus)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected Set<AssociationValue> |
extractAssociationValues(Class<? extends Saga> type,
EventMessage event)
Extracts the AssociationValues from the given
event as relevant for a Saga of given
sagaType . |
protected SagaInitializationPolicy |
getSagaCreationPolicy(Class<? extends Saga> type,
EventMessage event)
Returns the Saga Initialization Policy for a Saga of the given
sagaType and event . |
Class<?> |
getTargetType()
Returns the instance type that this proxy delegates all event handling to.
|
protected AssociationValue |
initialAssociationValue(EventMessage event)
Returns the association value to assign to a Saga when the given
event triggers the creation of
a new instance. |
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, getManagedSagaTypes, handle, preProcessSaga, setCorrelationDataProvider, setCorrelationDataProviders, setSuppressExceptions, setSynchronizeSagaAccess, subscribe, unsubscribe
@Deprecated public SimpleSagaManager(Class<? extends Saga> sagaType, SagaRepository sagaRepository, AssociationValueResolver associationValueResolver, EventBus eventBus)
SimpleSagaManager(Class, SagaRepository, AssociationValueResolver)
and register using
EventBus.subscribe(org.axonframework.eventhandling.EventListener)
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 to@Deprecated public SimpleSagaManager(Class<? extends Saga> sagaType, SagaRepository sagaRepository, AssociationValueResolver associationValueResolver, SagaFactory sagaFactory, EventBus eventBus)
SimpleSagaManager(Class, SagaRepository, AssociationValueResolver, SagaFactory)
and
register using EventBus.subscribe(org.axonframework.eventhandling.EventListener)
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 topublic SimpleSagaManager(Class<? extends Saga> sagaType, SagaRepository sagaRepository, AssociationValueResolver associationValueResolver)
sagaType
- The type of Saga managed by this SagaManagersagaRepository
- The repository providing access to Saga instancesassociationValueResolver
- The instance providing AssociationValues for incoming Eventspublic SimpleSagaManager(Class<? extends Saga> sagaType, SagaRepository sagaRepository, AssociationValueResolver associationValueResolver, SagaFactory sagaFactory)
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 instancesprotected SagaInitializationPolicy getSagaCreationPolicy(Class<? extends Saga> type, EventMessage event)
AbstractSagaManager
sagaType
and event
.
This policy provides the conditions to create new Saga instance, as well as the initial association of that
saga.getSagaCreationPolicy
in class AbstractSagaManager
type
- The type of Saga to get the creation policy forevent
- The Event that is being dispatched to Saga instancesprotected Set<AssociationValue> extractAssociationValues(Class<? extends Saga> type, EventMessage event)
AbstractSagaManager
event
as relevant for a Saga of given
sagaType
. A single event may be associated with multiple values.extractAssociationValues
in class AbstractSagaManager
type
- The type of Saga about to handle the Eventevent
- The event containing the association informationprotected AssociationValue initialAssociationValue(EventMessage event)
event
triggers the creation of
a new instance. If there are no creation handlers for the given event
, null
is
returned.event
- The event to resolve the initial association fornull
public 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()
EventListenerProxy
Copyright © 2010-2014. All Rights Reserved.