public interface SnapshotTrigger
It is up to the Trigger implementation to decide when, how and where a snapshot is triggered.
SnapshotTrigger implementations do not need to be thread-safe.
It is highly recommended to make trigger instances Serializable
. The trigger instance is attached to the
aggregate instance which it monitors, causing it to be cached and potentially serialized alongside it.
SnapshotTriggerDefinition
Modifier and Type | Method and Description |
---|---|
void |
eventHandled(EventMessage<?> msg)
Invoked when an event is handled by an aggregate.
|
void |
initializationFinished()
Invoked when the initialization of the aggregate based on passed events is completed.
|
void eventHandled(EventMessage<?> msg)
DomainEventMessage
, this is not guaranteed. The given message can either
be a historic Message from the Event Store, or one that has been just applied by the aggregate.msg
- The message handled by the aggregatevoid initializationFinished()
eventHandled(EventMessage)
involves an event being applied on "current state".Copyright © 2010–2020. All rights reserved.