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
  • Constructor Details

    • SpringAggregateSnapshotterFactoryBean

      public SpringAggregateSnapshotterFactoryBean()
  • Method Details

    • getObject

      public SpringAggregateSnapshotter getObject()
      Specified by:
      getObject in interface org.springframework.beans.factory.FactoryBean<SpringAggregateSnapshotter>
    • getObjectType

      public Class<?> getObjectType()
      Specified by:
      getObjectType in interface org.springframework.beans.factory.FactoryBean<SpringAggregateSnapshotter>
    • isSingleton

      public boolean isSingleton()
      Specified by:
      isSingleton in interface org.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 (see DefaultTransactionDefinition).
      Parameters:
      transactionDefinition - the transaction definition to use
    • setEventStore

      public void setEventStore(EventStore eventStore)
      Sets the Event Store instance to write the snapshots to
      Parameters:
      eventStore - The Event Store to store the snapshot events in
    • setRepositoryProvider

      public void setRepositoryProvider(RepositoryProvider repositoryProvider)
      Sets repository provider in order to have possibility to spawn new aggregates from THE aggregate.
      Parameters:
      repositoryProvider - Provides repositories for specific aggregate types
    • setHandlerDefinition

      public void setHandlerDefinition(HandlerDefinition handlerDefinition)
      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:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • setExecutor

      public void setExecutor(Executor executor)
      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