T
- The type of Saga managed by this instancepublic class AnnotatedSagaManager<T> extends AbstractSagaManager<T>
Constructor and Description |
---|
AnnotatedSagaManager(Class<T> sagaType,
SagaRepository<T> sagaRepository)
Initialize the AnnotatedSagaManager using given
repository to load sagas. |
AnnotatedSagaManager(Class<T> sagaType,
SagaRepository<T> sagaRepository,
ParameterResolverFactory parameterResolverFactory)
Initialize the AnnotatedSagaManager using given
repository to load sagas. |
AnnotatedSagaManager(Class<T> sagaType,
SagaRepository<T> sagaRepository,
Supplier<T> sagaFactory)
Initialize the AnnotatedSagaManager using given
repository to load sagas and sagaFactory to
create new sagas. |
AnnotatedSagaManager(Class<T> sagaType,
SagaRepository<T> sagaRepository,
Supplier<T> sagaFactory,
SagaModel<T> sagaMetaModel)
Initialize the AnnotatedSagaManager using given
repository to load sagas, the sagaFactory to
create new sagas and the sagaMetaModel to delegate messages to the saga instances. |
Modifier and Type | Method and Description |
---|---|
protected Set<AssociationValue> |
extractAssociationValues(EventMessage<?> event)
Extracts the AssociationValues from the given
event as relevant for a Saga of given
sagaType . |
protected SagaInitializationPolicy |
getSagaCreationPolicy(EventMessage<?> event)
Returns the Saga Initialization Policy for a Saga of the given
sagaType and event . |
boolean |
hasHandler(EventMessage<?> event)
Check whether or not this invoker has handlers that can handle the given
eventMessage . |
getSagaType, handle, setSuppressExceptions
public AnnotatedSagaManager(Class<T> sagaType, SagaRepository<T> sagaRepository)
repository
to load sagas. To create a new saga this
manager uses newInstance(Class)
. Uses a DefaultSagaMetaModelFactory
for the saga's meta model.sagaType
- the saga target typesagaRepository
- The repository providing access to the Saga instancespublic AnnotatedSagaManager(Class<T> sagaType, SagaRepository<T> sagaRepository, ParameterResolverFactory parameterResolverFactory)
repository
to load sagas. To create a new saga this
manager uses newInstance(Class)
. Uses a DefaultSagaMetaModelFactory
for the saga's meta model.sagaType
- the saga target typesagaRepository
- The repository providing access to the Saga instancesparameterResolverFactory
- The ParameterResolverFactory instance to resolve parameter values for annotated
handlers withpublic AnnotatedSagaManager(Class<T> sagaType, SagaRepository<T> sagaRepository, Supplier<T> sagaFactory)
repository
to load sagas and sagaFactory
to
create new sagas. Uses a DefaultSagaMetaModelFactory
for the saga's meta model.sagaType
- the saga target typesagaRepository
- The repository providing access to the Saga instancessagaFactory
- the factory for new saga instances of type T
public AnnotatedSagaManager(Class<T> sagaType, SagaRepository<T> sagaRepository, Supplier<T> sagaFactory, SagaModel<T> sagaMetaModel)
repository
to load sagas, the sagaFactory
to
create new sagas and the sagaMetaModel
to delegate messages to the saga instances.sagaType
- the saga target typesagaRepository
- The repository providing access to the Saga instancessagaFactory
- the factory for new saga instances of type T
sagaMetaModel
- the meta model to delegate messages to a saga instanceprotected SagaInitializationPolicy getSagaCreationPolicy(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<T>
event
- The Event that is being dispatched to Saga instancesprotected Set<AssociationValue> extractAssociationValues(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<T>
event
- The event containing the association informationpublic boolean hasHandler(EventMessage<?> event)
EventHandlerInvoker
eventMessage
.event
- The message to be processedtrue
if the invoker has one or more handlers that can handle the given message, false
otherwiseCopyright © 2010–2017. All rights reserved.