|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.saga.AbstractReplayAwareSagaManager org.axonframework.saga.AbstractSagaManager org.axonframework.saga.SimpleSagaManager
public class SimpleSagaManager
Simple SagaManager implementation. This implementation requires the Event that should cause new Saga's to be
created,
to be registered using setEventsToAlwaysCreateNewSagasFor(java.util.List)
and setEventsToOptionallyCreateNewSagasFor(java.util.List)
.
Method Summary | |
---|---|
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. |
Methods inherited from class org.axonframework.saga.AbstractSagaManager |
---|
commit, getManagedSagaTypes, handle, preProcessSaga, setCorrelationDataProvider, setCorrelationDataProviders, setSuppressExceptions, setSynchronizeSagaAccess, subscribe, unsubscribe |
Methods inherited from class org.axonframework.saga.AbstractReplayAwareSagaManager |
---|
afterReplay, beforeReplay, onReplayFailed, setReplayable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
@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 instancesMethod Detail |
---|
protected 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 instances
protected 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 information
protected 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 for
null
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |