Package org.axonframework.config
Class SagaConfigurer<T>
java.lang.Object
org.axonframework.config.SagaConfigurer<T>
- Type Parameters:
T- the Saga type under configuration
Provides mechanisms to configure the components used to manage and store Saga.
- Since:
- 4.0
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSagaConfigurer(Class<T> type) Initializes a configurer for the given Saga Type. -
Method Summary
Modifier and TypeMethodDescriptionconfigureRepository(Function<Configuration, SagaRepository<T>> repositoryBuilder) Configures aSagaRepositoryfor this Saga.configureSagaManager(Function<Configuration, AbstractSagaManager<T>> managerBuilder) Configures a Saga Manager for this Saga.configureSagaStore(Function<Configuration, SagaStore<? super T>> storeBuilder) Configures aSagaStorefor this Saga.static <T> SagaConfigurer<T> Retrieve theSagaConfigurerfor givensagaType.initialize(Configuration configuration) Initializes Saga Configuration by using the mainConfiguration.
-
Constructor Details
-
SagaConfigurer
Initializes a configurer for the given Saga Type.- Parameters:
type- the type of Saga
-
-
Method Details
-
forType
Retrieve theSagaConfigurerfor givensagaType.- Type Parameters:
T- a generic specifying the Saga type- Parameters:
sagaType- the type of the Saga- Returns:
- a
SagaConfigurerto configure a Saga with
-
configureSagaManager
public SagaConfigurer<T> configureSagaManager(Function<Configuration, AbstractSagaManager<T>> managerBuilder) Configures a Saga Manager for this Saga.- Parameters:
managerBuilder- aFunctionthat builds a Saga Manager- Returns:
- this
SagaConfigurerinstance, for fluent interfacing
-
configureRepository
public SagaConfigurer<T> configureRepository(Function<Configuration, SagaRepository<T>> repositoryBuilder) Configures aSagaRepositoryfor this Saga.- Parameters:
repositoryBuilder- aFunctionthat buildsSagaRepository- Returns:
- this
SagaConfigurerinstance, for fluent interfacing
-
configureSagaStore
public SagaConfigurer<T> configureSagaStore(Function<Configuration, SagaStore<? super T>> storeBuilder) Configures aSagaStorefor this Saga.- Parameters:
storeBuilder- aFunctionthat buildsSagaStore- Returns:
- this
SagaConfigurerinstance, for fluent interfacing
-
initialize
Initializes Saga Configuration by using the mainConfiguration. After initialization, it is safe to call accessor methods on this Configuration.- Parameters:
configuration- the mainConfigurationused to provide components to this Saga Configuration- Returns:
- the instance describing the Saga Configuration
-