static <CONFIG extends dk.cloudcreate.essentials.components.eventsourced.eventstore.postgresql.persistence.AggregateEventStreamConfiguration,ID,COMMAND,EVENT,ERROR,STATE> CommandHandler<COMMAND,EVENT,ERROR> |
CommandHandler.deciderBasedCommandHandler(dk.cloudcreate.essentials.components.eventsourced.eventstore.postgresql.ConfigurableEventStore<CONFIG> eventStore,
dk.cloudcreate.essentials.components.eventsourced.eventstore.postgresql.eventstream.AggregateType aggregateType,
Class<ID> aggregateIdType,
AggregateIdResolver<COMMAND,ID> aggregateIdFromCommandResolver,
AggregateIdResolver<EVENT,ID> aggregateIdFromEventResolver,
AggregateSnapshotRepository aggregateSnapshotRepository,
Class<STATE> stateType,
Decider<COMMAND,EVENT,ERROR,STATE> decider) |
Create an instance of a CommandHandler that is responsible for loading any existing Aggregate STATE from the underlying EventStore
and coordinate persisting any changes to the Aggregate, in the form of EVENT's, to the EventStore as part of an active UnitOfWork (if one exists)
The actual logic is delegated to an instance of a Decider
|