|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.saga.AbstractSagaManager
public abstract class AbstractSagaManager
Abstract implementation of the SagaManager interface that provides basic functionality required by most SagaManager implementations. Provides support for Saga lifecycle management and asynchronous handling of events.
| Constructor Summary | |
|---|---|
AbstractSagaManager(EventBus eventBus,
SagaRepository sagaRepository,
SagaFactory sagaFactory,
Class<? extends Saga>... sagaTypes)
Initializes the SagaManager with the given eventBus and sagaRepository. |
|
| Method Summary | |
|---|---|
protected void |
commit(Saga saga)
Commits the given saga to the registered repository. |
protected abstract AssociationValue |
extractAssociationValue(Class<? extends Saga> sagaType,
EventMessage event)
Extracts the AssociationValue from the given event as relevant for a Saga of given
sagaType. |
protected abstract SagaCreationPolicy |
getSagaCreationPolicy(Class<? extends Saga> sagaType,
EventMessage event)
Returns the Saga Creation Policy for a Saga of the given sagaType and event. |
void |
handle(EventMessage event)
Handles the event by passing it to all Saga instances that have an Association Value found in the given event. |
void |
setSuppressExceptions(boolean suppressExceptions)
Sets whether or not to suppress any exceptions that are cause by invoking Sagas. |
void |
setSynchronizeSagaAccess(boolean synchronizeSagaAccess)
Sets whether of not access to Saga's Event Handler should by synchronized. |
void |
subscribe()
Subscribe the EventListener with the configured EventBus. |
void |
unsubscribe()
Unsubscribe the EventListener with the configured EventBus. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.axonframework.eventhandling.EventListenerProxy |
|---|
getTargetType |
| Constructor Detail |
|---|
public AbstractSagaManager(EventBus eventBus,
SagaRepository sagaRepository,
SagaFactory sagaFactory,
Class<? extends Saga>... sagaTypes)
eventBus and sagaRepository.
eventBus - The event bus providing the events to route to sagas.sagaRepository - The repository providing the saga instances.sagaFactory - The factory providing new saga instancessagaTypes - The types of Saga supported by this Saga Manager| Method Detail |
|---|
public void handle(EventMessage event)
SagaManager
handle in interface EventListenerhandle in interface SagaManagerevent - the event to handle
protected abstract SagaCreationPolicy getSagaCreationPolicy(Class<? extends Saga> sagaType,
EventMessage event)
sagaType and event.
sagaType - The type of Saga to get the creation policy forevent - The Event that is being dispatched to Saga instances
protected abstract AssociationValue extractAssociationValue(Class<? extends Saga> sagaType,
EventMessage event)
event as relevant for a Saga of given
sagaType.
sagaType - The type of Saga about to handle the Eventevent - The event containing the association information
protected void commit(Saga saga)
saga to the registered repository.
saga - the Saga to commit.@PreDestroy public void unsubscribe()
unsubscribe in interface Subscribable@PostConstruct public void subscribe()
subscribe in interface Subscribablepublic void setSuppressExceptions(boolean suppressExceptions)
true.
suppressExceptions - whether or not to suppress exceptions from Sagas.public void setSynchronizeSagaAccess(boolean synchronizeSagaAccess)
true. Sets
to false only if the Saga managed by this manager are completely thread safe by themselves.
synchronizeSagaAccess - whether or not to synchronize access to Saga's event handlers.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||