package javadsl
- Alphabetic
- Public
- Protected
Type Members
- trait ChangeEventHandler[Command, State, ChangeEvent] extends AnyRef
API May Change: Implement this interface and use it in DurableStateBehavior#withChangeEventHandler to store additional change event when the state is updated.
API May Change: Implement this interface and use it in DurableStateBehavior#withChangeEventHandler to store additional change event when the state is updated. The event can be used in Projections.
The
updateHandler
anddeleteHandler
are invoked after the ordinary command handler. Be aware of that if the state is mutable and modified by the command handler the previous state parameter of theupdateHandler
will also include the modification, since it's the same instance. If that is a problem you need to use immutable state and create a new state instance when modifying it in the command handler.- Annotations
- @ApiMayChange()
- trait CommandHandler[Command, State] extends AnyRef
FunctionalInterface for reacting on commands
FunctionalInterface for reacting on commands
Used with CommandHandlerBuilder to setup the behavior of a DurableStateBehavior
- Annotations
- @FunctionalInterface()
- final class CommandHandlerBuilder[Command, State] extends AnyRef
- final class CommandHandlerBuilderByState[Command, S <: State, State] extends AnyRef
- trait CommandHandlerWithReply[Command, State] extends CommandHandler[Command, State]
FunctionalInterface for reacting on commands
FunctionalInterface for reacting on commands
Used with CommandHandlerWithReplyBuilder to setup the behavior of a DurableStateBehaviorWithEnforcedReplies
- Annotations
- @FunctionalInterface()
- final class CommandHandlerWithReplyBuilder[Command, State] extends AnyRef
- final class CommandHandlerWithReplyBuilderByState[Command, S <: State, State] extends AnyRef
- abstract class DurableStateBehavior[Command, State] extends DeferredBehavior[Command]
A
Behavior
for a persistent actor with durable storage of its state.A
Behavior
for a persistent actor with durable storage of its state.For projects using Java 17 and newer, also see DurableStateOnCommandBehavior
API May Change
- Annotations
- @ApiMayChange()
- abstract class DurableStateBehaviorWithEnforcedReplies[Command, State] extends DurableStateBehavior[Command, State]
A DurableStateBehavior that is enforcing that replies to commands are not forgotten.
A DurableStateBehavior that is enforcing that replies to commands are not forgotten. There will be compilation errors if the returned effect isn't a ReplyEffect, which can be created with
Effects().reply
,Effects().noReply
, EffectBuilder.thenReply, or EffectBuilder.thenNoReply. - abstract class DurableStateOnCommandBehavior[Command, State] extends DeferredBehavior[Command]
A
Behavior
for a persistent actor with durable storage of its state for projects built with Java 17 or newer where message handling can be done * using switch pattern match.A
Behavior
for a persistent actor with durable storage of its state for projects built with Java 17 or newer where message handling can be done * using switch pattern match.For building event sourced actors with Java versions before 17, see DurableStateBehavior
API May Change
- Annotations
- @ApiMayChange()
- abstract class DurableStateOnCommandWithReplyBehavior[Command, State] extends DeferredBehavior[Command]
A
Behavior
for a persistent actor with durable storage of its state for projects built with Java 17 or newer where message handling can be done * using switch pattern match.A
Behavior
for a persistent actor with durable storage of its state for projects built with Java 17 or newer where message handling can be done * using switch pattern match.Enforces replies to every received command.
For building event sourced actors with Java versions before 17, see DurableStateBehavior
API May Change
- Annotations
- @ApiMayChange()
- trait Effect[State] extends AnyRef
A command handler returns an
Effect
directive that defines what state to persist.A command handler returns an
Effect
directive that defines what state to persist.Instances of
Effect
are available through factories DurableStateBehavior.Effect.Not intended for user extension.
- Annotations
- @DoNotInherit()
- abstract class EffectBuilder[State] extends Effect[State]
A command handler returns an
Effect
directive that defines what state to persist.A command handler returns an
Effect
directive that defines what state to persist.Additional side effects can be performed in the callback
thenRun
Instances of
Effect
are available through factories DurableStateBehavior.Effect.Not intended for user extension.
- Annotations
- @DoNotInherit()
- sealed class EffectFactories[State] extends AnyRef
Factory methods for creating Effect directives - how a
DurableStateBehavior
reacts on a command.Factory methods for creating Effect directives - how a
DurableStateBehavior
reacts on a command. Created via DurableStateBehavior.Effect.Not for user extension
API May Change
- Annotations
- @ApiMayChange() @DoNotInherit()
- trait ReplyEffect[State] extends Effect[State]
DurableStateBehaviorWithEnforcedReplies can be used to enforce that replies are not forgotten.
DurableStateBehaviorWithEnforcedReplies can be used to enforce that replies are not forgotten. Then there will be compilation errors if the returned effect isn't a ReplyEffect, which can be created with
Effects().reply
,Effects().noReply
, EffectBuilder.thenReply, or EffectBuilder.thenNoReply.- Annotations
- @DoNotInherit()
- final class SignalHandler[State] extends AnyRef
- final class SignalHandlerBuilder[State] extends AnyRef
Mutable builder for handling signals in DurableStateBehavior
Mutable builder for handling signals in DurableStateBehavior
Not for user instantiation, use DurableStateBehavior.newSignalHandlerBuilder to get an instance.
Value Members
- object CommandHandlerBuilder
- object CommandHandlerBuilderByState
- object CommandHandlerWithReplyBuilder
- object CommandHandlerWithReplyBuilderByState
- object SignalHandler
- object SignalHandlerBuilder