Inspired by akka.actor.AbstractActor
Dispatcher - When sending something to an ES, use its dispatcher Command - Dispatchable message - When sent to the dispatcher, it will be sent to the correct ES.
Dispatcher - When sending something to an ES, use its dispatcher Command - Dispatchable message - When sent to the dispatcher, it will be sent to the correct ES.
Event - Represents a change of state for an ES
State is immutable. Represents the full state of the entity. based on its state it can accept or reject an event. Has with method transition(event) - if ok, it returns new state. If not, an error is thrown.
Can be used to try an event (since it is mutable)
DurableMessage: method of sending a message which with retry-mechanism until confirm() is called.
GeneralAggregate pseudocode:
for each received cmd: convert it to event try the event (by calling state.transition() ) if it failed: maybe do something if it works: persist event generate and send DurableMessages change our current state (by calling state.transition() and keeping the result )
Superclass/trait representing your events
The type representing your state
The type representing your state
(Since version 1.0.7) This impl is too complicated with all the different generateDMs*-methods - Instead use GeneralAggregateBAse which has one single generic generateDMs-method
(Since version 1.0.3)
(Since version 1.0.3) Use AggregateStarter and AggregateViewStarter with GeneralAggregateViewJava instead
(Since version 1.0.7) Use ResultingDMs and GeneralAggregateBase instead
(Since version 1.0.7) Use ResultingDMs and GeneralAggregateBase instead
Inspired by akka.actor.AbstractActor
Use CmdToEventBuilder the same way you use ReceiveBuilder
The type representing your state