Decider And Aggregate Type Configurator
Configurator that registers all aggregateTypeConfigurations with the eventStore and all deciders with the CommandBus wrapped in a DeciderCommandHandlerAdapter
If you register this class as a Bean in Spring then it will automatically handle the event sourcing and Decider configuration:
@Bean
fun deciderAndAggregateTypeConfigurator(eventStore: ConfigurableEventStore<*>,
commandBus: CommandBus,
aggregateTypeConfigurations: List<AggregateTypeConfiguration>,
deciders: List<Decider<*, *>>) : DeciderAndAggregateTypeConfigurator {
return DeciderAndAggregateTypeConfigurator(eventStore, commandBus, aggregateTypeConfigurations, deciders)
}Parameters
The EventStore that can fetch and persist events
The CommandBus where all Decider's in the deciders list will be registered as CommandHandler
The AggregateTypeConfiguration's - these are registered with the EventStore to ensure that the EventStore is configured to handle event streams related to the AggregateType's The AggregateTypeConfiguration.deciderSupportsAggregateTypeChecker is used to determine which AggregateType each Decider works with
All the Decider's that should be as CommandHandler's on the commandBus