|
||||||||||
| 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
| Constructor Summary | |
|---|---|
AbstractSagaManager(EventBus eventBus,
SagaRepository sagaRepository,
SagaFactory sagaFactory)
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
|
createSaga(Class<T> sagaType)
Create a new instance of a Saga of the given sagaType. |
|
protected abstract Set<Saga> |
findSagas(Event event)
Finds the saga instances that the given event needs to be routed to. |
|
protected EventBus |
getEventBus()
Returns the EventBus that delivers the events to route to Sagas. |
|
protected SagaRepository |
getSagaRepository()
Returns the repository that provides access to Saga instances. |
|
void |
handle(Event 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 |
| Constructor Detail |
|---|
public AbstractSagaManager(EventBus eventBus,
SagaRepository sagaRepository,
SagaFactory sagaFactory)
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 instances| Method Detail |
|---|
public void handle(Event event)
SagaManager
handle in interface EventListenerhandle in interface SagaManagerevent - the event to handleprotected <T extends Saga> T createSaga(Class<T> sagaType)
sagaType. Resources must have been injected into the
Saga before returning it.
T - The type of Saga to create an instance forsagaType - The type of Saga to create an instance for
protected abstract Set<Saga> findSagas(Event event)
event needs to be routed to. The event is sent to each of
the returned instances.
event - The event to find relevant Sagas for
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 Subscribableprotected EventBus getEventBus()
protected SagaRepository getSagaRepository()
public 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 | |||||||||