DeciderAndAggregateTypeConfigurator

class DeciderAndAggregateTypeConfigurator(eventStore: ConfigurableEventStore<*>, commandBus: CommandBus, aggregateTypeConfigurations: List<AggregateTypeConfiguration>, deciders: List<Decider<*, *>>)

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

eventStore

The EventStore that can fetch and persist events

commandBus

The CommandBus where all Decider's in the deciders list will be registered as CommandHandler

aggregateTypeConfigurations

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

deciders

All the Decider's that should be as CommandHandler's on the commandBus

Constructors

Link copied to clipboard
constructor(eventStore: ConfigurableEventStore<*>, commandBus: CommandBus, aggregateTypeConfigurations: List<AggregateTypeConfiguration>, deciders: List<Decider<*, *>>)