public interface Configurer
Using DefaultConfigurer.defaultConfiguration()
, you will get a Configurer instance with default components
configured. You will need to register your Aggregates (using configureAggregate(AggregateConfiguration)
and
provide a repository implementation for each of them, or if you wish to use event sourcing, register your aggregates
through configureAggregate(Class)
and configure an Event Store (configureEventStore(Function)
or
configureEmbeddedEventStore(Function)
).
DefaultConfigurer
Modifier and Type | Method and Description |
---|---|
Configuration |
buildConfiguration()
Returns the completely initialized Configuration built using this configurer.
|
<A> Configurer |
configureAggregate(AggregateConfiguration<A> aggregateConfiguration)
Configures an Aggregate in this configuration based on the given
aggregateConfiguration . |
default <A> Configurer |
configureAggregate(Class<A> aggregate)
Configures an Aggregate using default settings.
|
default Configurer |
configureCommandBus(Function<Configuration,CommandBus> commandBusBuilder)
Configure the given Command Bus to use in this configuration.
|
Configurer |
configureCorrelationDataProviders(Function<Configuration,List<CorrelationDataProvider>> correlationDataProviderBuilder)
Configures the CorrelationDataProviders that Message processing components should use to attach correlation data
to outgoing messages.
|
Configurer |
configureEmbeddedEventStore(Function<Configuration,EventStorageEngine> storageEngineBuilder)
Configure an Embedded Event Store which uses the given Event Storage Engine to store its events.
|
default Configurer |
configureEventBus(Function<Configuration,EventBus> eventBusBuilder)
Configure the given Event Bus to use in this configuration.
|
default Configurer |
configureEventStore(Function<Configuration,EventStore> eventStoreBuilder)
Configure the given Event Store to use in this configuration.
|
Configurer |
configureMessageMonitor(Function<Configuration,BiFunction<Class<?>,String,MessageMonitor<Message<?>>>> messageMonitorFactoryBuilder)
Configure the Message Monitor to use for the Message processing components in this configuration.
|
default Configurer |
configureResourceInjector(Function<Configuration,ResourceInjector> resourceInjectorBuilder)
Configure the given Resource Injector to use for Sagas in this configuration.
|
default Configurer |
configureSerializer(Function<Configuration,Serializer> serializerBuilder)
Configure the given Serializer to use in this configuration.
|
default Configurer |
configureTransactionManager(Function<Configuration,TransactionManager> transactionManagerBuilder)
Configure the given Transaction Manager to use in this configuration.
|
Configurer |
registerCommandHandler(Function<Configuration,Object> annotatedCommandHandlerBuilder)
Registers a command handler bean with this configuration.
|
<C> Configurer |
registerComponent(Class<C> componentType,
Function<Configuration,? extends C> componentBuilder)
Register a component which should be made available to other components or modules in this Configuration.
|
Configurer |
registerModule(ModuleConfiguration module)
Register an Axon module with this configuration.
|
default Configuration |
start()
Builds the configuration and starts it immediately.
|
Configurer configureMessageMonitor(Function<Configuration,BiFunction<Class<?>,String,MessageMonitor<Message<?>>>> messageMonitorFactoryBuilder)
messageMonitorFactoryBuilder
- The MessageMonitor builder functionConfigurer configureCorrelationDataProviders(Function<Configuration,List<CorrelationDataProvider>> correlationDataProviderBuilder)
correlationDataProviderBuilder
- the builder function returning the CorrelationDataProvider listConfigurer registerModule(ModuleConfiguration module)
Typically, modules are registered for Event Handling components or Sagas.
module
- The module to registerSagaConfiguration
,
EventHandlingConfiguration
<C> Configurer registerComponent(Class<C> componentType, Function<Configuration,? extends C> componentBuilder)
Where possible, it is recommended to use the explicit configure...
and register...
methods.
C
- The type of componentcomponentType
- The declared type of the components, typically an interfacecomponentBuilder
- The builder function of this componentConfigurer registerCommandHandler(Function<Configuration,Object> annotatedCommandHandlerBuilder)
The builder function receives the Configuration as input, and is expected to return a fully initialized instance of the command handler bean.
annotatedCommandHandlerBuilder
- The builder function of the Command Handler beanConfigurer configureEmbeddedEventStore(Function<Configuration,EventStorageEngine> storageEngineBuilder)
EventStorageEngine
instance.storageEngineBuilder
- The builder function for the EventStorageEngine
default Configurer configureEventStore(Function<Configuration,EventStore> eventStoreBuilder)
EventStore
instance.eventStoreBuilder
- The builder function for the EventStore
default Configurer configureEventBus(Function<Configuration,EventBus> eventBusBuilder)
EventBus
instance.
Note that this builder should not be used when an Event Store is configured. Since Axon 3, the Event Store will act as Event Bus implementation as well.
eventBusBuilder
- The builder function for the EventBus
default Configurer configureCommandBus(Function<Configuration,CommandBus> commandBusBuilder)
CommandBus
instance.commandBusBuilder
- The builder function for the CommandBus
default Configurer configureSerializer(Function<Configuration,Serializer> serializerBuilder)
Serializer
instance.serializerBuilder
- The builder function for the Serializer
default Configurer configureTransactionManager(Function<Configuration,TransactionManager> transactionManagerBuilder)
TransactionManager
instance.transactionManagerBuilder
- The builder function for the TransactionManager
default Configurer configureResourceInjector(Function<Configuration,ResourceInjector> resourceInjectorBuilder)
ResourceInjector
instance.resourceInjectorBuilder
- The builder function for the ResourceInjector
<A> Configurer configureAggregate(AggregateConfiguration<A> aggregateConfiguration)
aggregateConfiguration
. This method
allows for more fine-grained configuration compared to the configureAggregate(Class)
method.A
- the type of aggregate the configuration is foraggregateConfiguration
- The instance describing the configuration of an AggregateAggregateConfigurer
default <A> Configurer configureAggregate(Class<A> aggregate)
configureAggregate(AggregateConfiguration)
must be used to register the aggregate.A
- The type of aggregateaggregate
- The aggregate type to register with the ConfigurationConfiguration buildConfiguration()
default Configuration start()
Copyright © 2010–2017. All rights reserved.