org.axonframework.saga.annotation
Class AnnotatedSagaManager

java.lang.Object
  extended by org.axonframework.saga.AbstractSagaManager
      extended by 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

Constructor Summary
AnnotatedSagaManager(SagaRepository sagaRepository, EventBus eventBus, Class<? extends AbstractAnnotatedSaga>... sagaClasses)
          Initialize the AnnotatedSagaManager using the given resources, and using a GenericSagaFactory.
AnnotatedSagaManager(SagaRepository sagaRepository, SagaFactory sagaFactory, EventBus eventBus, Class<? extends AbstractAnnotatedSaga>... sagaClasses)
          Initialize the AnnotatedSagaManager using the given resources, and using a GenericSagaFactory.
 
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 org.axonframework.saga.AbstractSagaManager
commit, createSaga, getEventBus, getSagaRepository, handle, setSuppressExceptions, setSynchronizeSagaAccess, subscribe, unsubscribe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 instances
eventBus - The event bus publishing the events
sagaClasses - 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 instances
sagaFactory - The factory creating new instances of a Saga
eventBus - The event bus publishing the events
sagaClasses - The types of Saga that this instance should manage
Method Detail

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.