Class SpringAggregateSnapshotterFactoryBean
java.lang.Object
org.axonframework.spring.eventsourcing.SpringAggregateSnapshotterFactoryBean
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.FactoryBean<SpringAggregateSnapshotter>,org.springframework.context.ApplicationContextAware
public class SpringAggregateSnapshotterFactoryBean
extends Object
implements org.springframework.beans.factory.FactoryBean<SpringAggregateSnapshotter>, org.springframework.context.ApplicationContextAware
Implementation of the
AggregateSnapshotter that eases the configuration when
used within a Spring Application Context. It will automatically detect a Transaction Manager and Aggregate
Factories.- Since:
- 0.6
- Author:
- Allard Buijze
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<?> booleanvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetEventStore(EventStore eventStore) Sets the Event Store instance to write the snapshots tovoidsetExecutor(Executor executor) Sets the executor to process the creation (and storage) of each snapshot.voidsetHandlerDefinition(HandlerDefinition handlerDefinition) Sets handler definition to be able to create concrete handlers.voidsetRepositoryProvider(RepositoryProvider repositoryProvider) Sets repository provider in order to have possibility to spawn new aggregates from THE aggregate.voidsetTransactionDefinition(org.springframework.transaction.TransactionDefinition transactionDefinition) Optionally sets the transaction definition to use.voidsetTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) Sets the transaction manager to manager underlying transaction with.
-
Constructor Details
-
SpringAggregateSnapshotterFactoryBean
public SpringAggregateSnapshotterFactoryBean()
-
-
Method Details
-
getObject
- Specified by:
getObjectin interfaceorg.springframework.beans.factory.FactoryBean<SpringAggregateSnapshotter>
-
getObjectType
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<SpringAggregateSnapshotter>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingletonin interfaceorg.springframework.beans.factory.FactoryBean<SpringAggregateSnapshotter>
-
setTransactionManager
public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) Sets the transaction manager to manager underlying transaction with. If none is provided, an attempt is made to auto detect is from the application context. If a single transaction manager is found, it is used to manage transactions. Of none or more than one is found, they are ignored.- Parameters:
transactionManager- the transaction manager managing underlying transactions
-
setTransactionDefinition
public void setTransactionDefinition(org.springframework.transaction.TransactionDefinition transactionDefinition) Optionally sets the transaction definition to use. By default, uses the application context's default transaction semantics (seeDefaultTransactionDefinition).- Parameters:
transactionDefinition- the transaction definition to use
-
setEventStore
Sets the Event Store instance to write the snapshots to- Parameters:
eventStore- The Event Store to store the snapshot events in
-
setRepositoryProvider
Sets repository provider in order to have possibility to spawn new aggregates from THE aggregate.- Parameters:
repositoryProvider- Provides repositories for specific aggregate types
-
setHandlerDefinition
Sets handler definition to be able to create concrete handlers.- Parameters:
handlerDefinition- The handler definition used to create concrete handlers
-
setApplicationContext
public void setApplicationContext(@Nonnull org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
setExecutor
Sets the executor to process the creation (and storage) of each snapshot. Defaults to an executer that runs the task in the calling thread.- Parameters:
executor- The executor to process creation and storage of the snapshots with
-