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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
    boolean
     
    void
    setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
     
    void
    setEventStore(org.axonframework.eventsourcing.eventstore.EventStore eventStore)
    Sets the Event Store instance to write the snapshots to
    void
    Sets the executor to process the creation (and storage) of each snapshot.
    void
    setHandlerDefinition(org.axonframework.messaging.annotation.HandlerDefinition handlerDefinition)
    Sets handler definition to be able to create concrete handlers.
    void
    setRepositoryProvider(org.axonframework.modelling.command.RepositoryProvider repositoryProvider)
    Sets repository provider in order to have possibility to spawn new aggregates from THE aggregate.
    void
    setTransactionDefinition(org.springframework.transaction.TransactionDefinition transactionDefinition)
    Optionally sets the transaction definition to use.
    void
    setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
    Sets the transaction manager to manager underlying transaction with.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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(org.axonframework.eventsourcing.eventstore.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(org.axonframework.modelling.command.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(org.axonframework.messaging.annotation.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