org.axonframework.saga.annotation
Class AnnotatedSagaManager
java.lang.Object
org.axonframework.saga.AbstractSagaManager
org.axonframework.saga.annotation.AnnotatedSagaManager
- All Implemented Interfaces:
- EventListener, SagaManager, Subscribable
public class AnnotatedSagaManager
- extends AbstractSagaManager
Implementation of the SagaManager that uses annotations on the Sagas to describe the lifecycle management. Unlike the
SimpleSagaManager, this implementation can manage several types of Saga in a single AnnotatedSagaManager.
- Since:
- 0.7
- Author:
- Allard Buijze
|
Method Summary |
protected Set<Saga> |
findSagas(Event event)
Finds the saga instances that the given event needs to be routed to. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AnnotatedSagaManager
public AnnotatedSagaManager(SagaRepository sagaRepository,
EventBus eventBus,
Class<? extends AbstractAnnotatedSaga>... sagaClasses)
- Initialize the AnnotatedSagaManager using the given resources, and using a
GenericSagaFactory.
- Parameters:
sagaRepository - The repository providing access to the Saga instanceseventBus - The event bus publishing the eventssagaClasses - The types of Saga that this instance should manage
AnnotatedSagaManager
public AnnotatedSagaManager(SagaRepository sagaRepository,
SagaFactory sagaFactory,
EventBus eventBus,
Class<? extends AbstractAnnotatedSaga>... sagaClasses)
- Initialize the AnnotatedSagaManager using the given resources, and using a
GenericSagaFactory.
- Parameters:
sagaRepository - The repository providing access to the Saga instancessagaFactory - The factory creating new instances of a SagaeventBus - The event bus publishing the eventssagaClasses - The types of Saga that this instance should manage
findSagas
protected Set<Saga> findSagas(Event event)
- Description copied from class:
AbstractSagaManager
- Finds the saga instances that the given
event needs to be routed to. The event is sent to each of
the returned instances.
- Specified by:
findSagas in class AbstractSagaManager
- Parameters:
event - The event to find relevant Sagas for
- Returns:
- The Set of relevant Sagas
Copyright © 2011. All Rights Reserved.