Class CachingSagaStore.Builder<T>
java.lang.Object
org.axonframework.modelling.saga.repository.CachingSagaStore.Builder<T>
- Type Parameters:
T- a generic specifying the Saga type contained in thisSagaRepositoryimplementation
- Enclosing class:
CachingSagaStore<T>
Builder class to instantiate a
CachingSagaStore.
The delegateSagaStore of type SagaStore, the associationsCache and sagaCache
(both of type Cache) are hard requirements and as such should be provided.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassociationsCache(Cache associationsCache) Sets theassociationsCacheof typeCacheused to store Saga associations with.build()Initializes aCachingSagaStoreas specified through this Builder.delegateSagaStore(SagaStore<T> delegateSagaStore) Sets theSagaStoreinstance providing access to (persisted) entries.Sets thesagaCacheof typeCacheused to store Sagas with.protected voidvalidate()Validates whether the fields contained in this Builder are set accordingly.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
delegateSagaStore
Sets theSagaStoreinstance providing access to (persisted) entries.- Parameters:
delegateSagaStore- theSagaStoreinstance providing access to (persisted) entries- Returns:
- the current Builder instance, for fluent interfacing
-
associationsCache
Sets theassociationsCacheof typeCacheused to store Saga associations with.- Parameters:
associationsCache- aCacheused to store Saga associations with- Returns:
- the current Builder instance, for fluent interfacing
-
sagaCache
Sets thesagaCacheof typeCacheused to store Sagas with.- Parameters:
sagaCache- aCacheused to store Sagas with- Returns:
- the current Builder instance, for fluent interfacing
-
build
Initializes aCachingSagaStoreas specified through this Builder.- Returns:
- a
CachingSagaStoreas specified through this Builder
-
validate
Validates whether the fields contained in this Builder are set accordingly.- Throws:
AxonConfigurationException- if one field is asserted to be incorrect according to the Builder's specifications
-