org.axonframework.eventsourcing
Class SpringAggregateSnapshotter
java.lang.Object
org.axonframework.eventsourcing.AbstractSnapshotter
org.axonframework.eventsourcing.AggregateSnapshotter
org.axonframework.eventsourcing.SpringAggregateSnapshotter
- All Implemented Interfaces:
- Snapshotter, org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware
public class SpringAggregateSnapshotter
- extends AggregateSnapshotter
- implements org.springframework.beans.factory.InitializingBean, 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.
The only mandatory properties to set is AbstractSnapshotter.setEventStore(org.axonframework.eventstore.SnapshotEventStore). In
most cases, you should also provide an executor, as the default will execute snapshotter tasks in the calling
thread.
- Since:
- 0.6
- Author:
- Allard Buijze
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SpringAggregateSnapshotter
public 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 (see
DefaultTransactionDefinition).
- Parameters:
transactionDefinition - the transaction definition to use
afterPropertiesSet
public void afterPropertiesSet()
throws Exception
- Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
- Throws:
Exception
setAggregateFactories
public void setAggregateFactories(List<AggregateFactory<?>> aggregateFactories)
- Optionally sets the aggregate factories to use. By default, this implementation will auto detect available
factories from the application context. Configuring them using this method will prevent auto detection.
- Overrides:
setAggregateFactories in class AggregateSnapshotter
- Parameters:
aggregateFactories - The list of aggregate factories creating the aggregates to store.
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
- Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
Copyright © 2010-2016. All Rights Reserved.