Package akka.persistence.fsm
Interface PersistentFSM<S extends PersistentFSM.FSMState,D,E>
-
- All Superinterfaces:
Actor
,ActorLogging
,Eventsourced
,Listeners
,PersistenceIdentity
,PersistenceRecovery
,PersistenceStash
,PersistentActor
,PersistentFSMBase<S,D,E>
,RequiresMessageQueue<DequeBasedMessageQueueSemantics>
,Snapshotter
,Stash
,StashFactory
,StashSupport
,UnrestrictedStash
- All Known Implementing Classes:
AbstractPersistentFSM
,AbstractPersistentLoggingFSM
public interface PersistentFSM<S extends PersistentFSM.FSMState,D,E> extends PersistentActor, PersistentFSMBase<S,D,E>, ActorLogging
Deprecated.Use EventSourcedBehavior. Since 2.6.0.A FSM implementation with persistent state.Supports the usual
FSM
functionality with additional persistence features.PersistentFSM
is identified by 'persistenceId' value. State changes are persisted atomically together with domain events, which means that either both succeed or both fail, i.e. a state transition event will not be stored if persistence of an event related to that change fails. Persistence execution order is: persist -> wait for ack -> apply state. Incoming messages are deferred until the state is applied. State Data is constructed based on domain events, according to user's implementation of applyEvent function.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
PersistentFSM.$minus$greater$
Deprecated.This extractor is just convenience for matching a (S, S) pair, including a reminder what the new state is.static class
PersistentFSM.CurrentState<S>
Deprecated.Message type which is sent directly to the subscribed actor inFSM.SubscribeTransitionCallBack
before sending anyFSM.Transition
messages.static class
PersistentFSM.CurrentState$
Deprecated.static class
PersistentFSM.Event<D>
Deprecated.All messages sent to theFSM
will be wrapped inside anEvent
, which allows pattern matching to extract both state and data.static class
PersistentFSM.Event$
Deprecated.static class
PersistentFSM.Failure
Deprecated.Signifies that theFSM
is shutting itself down because of an error, e.g.static class
PersistentFSM.Failure$
Deprecated.static class
PersistentFSM.FixedDelayMode$
Deprecated.INTERNAL APIstatic class
PersistentFSM.FixedRateMode$
Deprecated.INTERNAL APIstatic interface
PersistentFSM.FSMState
Deprecated.FSMState base trait, makes possible for simple default serialization by conversion to Stringstatic class
PersistentFSM.LogEntry<S,D>
Deprecated.Log Entry of theLoggingFSM
, can be obtained by callinggetLog
.static class
PersistentFSM.LogEntry$
Deprecated.static class
PersistentFSM.Normal$
Deprecated.Default reason if callingstop()
.static class
PersistentFSM.NullFunction$
Deprecated.A partial function value which does not match anything and can be used to “reset”whenUnhandled
andonTermination
handlers.static interface
PersistentFSM.PersistentFsmEvent
Deprecated.Base persistent event classstatic class
PersistentFSM.PersistentFSMSnapshot<D>
Deprecated.FSM state and data snapshotstatic class
PersistentFSM.PersistentFSMSnapshot$
Deprecated.static interface
PersistentFSM.Reason
Deprecated.Reason why thisFSM
is shutting down.static class
PersistentFSM.Shutdown$
Deprecated.Reason given when someone was callingsystem.stop(fsm)
from outside; also applies toStop
supervision directive.static class
PersistentFSM.SingleMode$
Deprecated.INTERNAL APIstatic class
PersistentFSM.State<S,D,E>
Deprecated.This captures all of the managed state of theFSM
: the state name, the state data, possibly custom timeout, stop reason, replies accumulated while processing the last message, possibly domain event and handler to be executed after FSM moves to the new state (also triggered when staying in the same state)static class
PersistentFSM.State$
Deprecated.static class
PersistentFSM.StateChangeEvent
Deprecated.Persisted on state change Not deprecated as used for users migrating from PersistentFSM to EventSourcedBehaviorstatic class
PersistentFSM.StateChangeEvent$
Deprecated.static class
PersistentFSM.StateTimeout$
Deprecated.This case object is received in case of a state timeout.static class
PersistentFSM.StopEvent<S,D>
Deprecated.Case class representing the state of theFSM
whithin theonTermination
block.static class
PersistentFSM.StopEvent$
Deprecated.static class
PersistentFSM.SubscribeTransitionCallBack
Deprecated.Send this to anFSM
to request first thePersistentFSM.CurrentState
and then a series ofPersistentFSM.Transition
updates.static class
PersistentFSM.SubscribeTransitionCallBack$
Deprecated.static class
PersistentFSM.TimeoutMarker
Deprecated.INTERNAL APIstatic class
PersistentFSM.TimeoutMarker$
Deprecated.static class
PersistentFSM.Timer
Deprecated.INTERNAL APIstatic class
PersistentFSM.Timer$
Deprecated.static interface
PersistentFSM.TimerMode
Deprecated.INTERNAL APIstatic class
PersistentFSM.Transition<S>
Deprecated.Message type which is used to communicate transitions between states to all subscribed listeners (useFSM.SubscribeTransitionCallBack
).static class
PersistentFSM.Transition$
Deprecated.static class
PersistentFSM.UnsubscribeTransitionCallBack
Deprecated.Unsubscribe fromFSM.Transition
notifications which was effected by sending the correspondingFSM.SubscribeTransitionCallBack
.static class
PersistentFSM.UnsubscribeTransitionCallBack$
Deprecated.-
Nested classes/interfaces inherited from interface akka.actor.Actor
Actor.emptyBehavior$, Actor.ignoringBehavior$
-
Nested classes/interfaces inherited from interface akka.persistence.Eventsourced
Eventsourced.AsyncHandlerInvocation, Eventsourced.AsyncHandlerInvocation$, Eventsourced.PendingHandlerInvocation, Eventsourced.RecoveryTick, Eventsourced.RecoveryTick$, Eventsourced.StashingHandlerInvocation, Eventsourced.StashingHandlerInvocation$
-
Nested classes/interfaces inherited from interface akka.persistence.fsm.PersistentFSMBase
PersistentFSMBase.TransformHelper
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
akka$persistence$fsm$PersistentFSM$_setter_$domainEventTag_$eq(scala.reflect.ClassTag<E> x$1)
Deprecated.Domain event'sClassTag
Used for identifying domain events during recoveryD
applyEvent(E domainEvent, D currentData)
Deprecated.Override this handler to define the action on Domain Eventvoid
applyState(PersistentFSM.State<S,D,E> nextState)
Deprecated.Persist FSM State and FSM State Datavoid
currentStateTimeout_$eq(scala.Option<scala.concurrent.duration.FiniteDuration> x$1)
Deprecated.scala.reflect.ClassTag<E>
domainEventClassTag()
Deprecated.Enables to pass a ClassTag of a domain event base type from the implementing classscala.reflect.ClassTag<E>
domainEventTag()
Deprecated.Domain event'sClassTag
Used for identifying domain events during recoveryvoid
onRecoveryCompleted()
Deprecated.Override this handler to define the action on recovery completionscala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit>
receiveCommand()
Deprecated.After recovery events are handled as in usual FSM actorscala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit>
receiveRecover()
Deprecated.Discover the latest recorded statevoid
saveStateSnapshot()
Deprecated.Save the current state as a snapshotscala.collection.immutable.Map<java.lang.String,S>
statesMap()
Deprecated.Map from state identifier to state instancevoid
super$applyState(PersistentFSM.State<S,D,E> nextState)
Deprecated.Persist FSM State and FSM State Data-
Methods inherited from interface akka.actor.Actor
akka$actor$Actor$_setter_$context_$eq, akka$actor$Actor$_setter_$self_$eq, context, postRestart, preStart, self, sender, supervisorStrategy
-
Methods inherited from interface akka.actor.ActorLogging
_log_$eq, log
-
Methods inherited from interface akka.persistence.Eventsourced
_lastSequenceNr_$eq, aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, batchAtomicWrite, changeState, currentState_$eq, deleteMessages, eventBatch_$eq, flushBatch, flushJournalBatch, internalDefer, internalDeferAsync, internalDeleteMessagesBeforeSnapshot, internalPersist, internalPersistAll, internalPersistAllAsync, internalPersistAsync, journal, journalBatch_$eq, lastSequenceNr, log, nextSequenceNr, onPersistFailure, onPersistRejected, onRecoveryFailure, onReplaySuccess, peekApplyHandler, pendingStashingPersistInvocations_$eq, recovering, recoveryFinished, recoveryRunning, recoveryStarted, requestRecoveryPermit, sendBatchedEventsToJournal, sequenceNr_$eq, setLastSequenceNr, snapshotSequenceNr, snapshotStore, snapshotterId, startRecovery, stash, stashInternally, super$aroundPostRestart, super$aroundPostStop, super$aroundPreRestart, super$aroundPreStart, super$aroundReceive, super$stash, super$unhandled, unhandled, unstashAll, unstashInternally, updateLastSequenceNr, waitingRecoveryPermit, writeEventFailed, writeEventRejected, writeEventSucceeded, writeInProgress_$eq
-
Methods inherited from interface akka.routing.Listeners
akka$routing$Listeners$_setter_$listeners_$eq, gossip, gossip$default$2, listenerManagement, listeners
-
Methods inherited from interface akka.persistence.PersistenceIdentity
journalPluginId, persistenceId, snapshotPluginId
-
Methods inherited from interface akka.persistence.PersistenceRecovery
recovery
-
Methods inherited from interface akka.persistence.PersistenceStash
internalStashOverflowStrategy
-
Methods inherited from interface akka.persistence.PersistentActor
defer, deferAsync, persist, persistAll, persistAllAsync, persistAsync, receive
-
Methods inherited from interface akka.persistence.fsm.PersistentFSMBase
$minus$greater, akka$persistence$fsm$PersistentFSMBase$_setter_$Event_$eq, akka$persistence$fsm$PersistentFSMBase$_setter_$StateTimeout_$eq, akka$persistence$fsm$PersistentFSMBase$_setter_$StopEvent_$eq, cancelTimer, currentState_$eq, debugEvent, Event, generation_$eq, handleEvent_$eq, handleTransition, initialize, isStateTimerActive, isTimerActive, logTermination, makeTransition, nextState_$eq, nextStateData, onTermination, onTransition, postStop, processEvent, processMsg, receive, register, setStateTimeout, setTimer, setTimer$default$4, startSingleTimer, startTimer, startTimerAtFixedRate, startTimerWithFixedDelay, startWith, startWith$default$3, stateData, stateName, stateNames, StateTimeout, stay, stop, stop, stop, StopEvent, super$postStop, terminate, terminateEvent_$eq, timeoutFuture_$eq, total2pf, transform, transitionEvent_$eq, when, when$default$2, whenUnhandled
-
Methods inherited from interface akka.persistence.Snapshotter
deleteSnapshot, deleteSnapshots, loadSnapshot, saveSnapshot
-
Methods inherited from interface akka.actor.StashFactory
createStash
-
Methods inherited from interface akka.actor.StashSupport
actorCell, akka$actor$StashSupport$_setter_$mailbox_$eq, clearStash, context, enqueueFirst, mailbox, prepend, self, theStash_$eq, unstash, unstashAll
-
Methods inherited from interface akka.actor.UnrestrictedStash
postStop, preRestart, super$postStop, super$preRestart
-
-
-
-
Method Detail
-
akka$persistence$fsm$PersistentFSM$_setter_$domainEventTag_$eq
void akka$persistence$fsm$PersistentFSM$_setter_$domainEventTag_$eq(scala.reflect.ClassTag<E> x$1)
Deprecated.Domain event'sClassTag
Used for identifying domain events during recovery
-
super$applyState
void super$applyState(PersistentFSM.State<S,D,E> nextState)
Deprecated.Persist FSM State and FSM State Data
-
domainEventClassTag
scala.reflect.ClassTag<E> domainEventClassTag()
Deprecated.Enables to pass a ClassTag of a domain event base type from the implementing class- Returns:
ClassTag
of domain event base type
-
domainEventTag
scala.reflect.ClassTag<E> domainEventTag()
Deprecated.Domain event'sClassTag
Used for identifying domain events during recovery
-
statesMap
scala.collection.immutable.Map<java.lang.String,S> statesMap()
Deprecated.Map from state identifier to state instance
-
currentStateTimeout_$eq
void currentStateTimeout_$eq(scala.Option<scala.concurrent.duration.FiniteDuration> x$1)
Deprecated.
-
applyEvent
D applyEvent(E domainEvent, D currentData)
Deprecated.Override this handler to define the action on Domain Event- Parameters:
domainEvent
- domain event to applycurrentData
- state data of the previous state- Returns:
- updated state data
-
onRecoveryCompleted
void onRecoveryCompleted()
Deprecated.Override this handler to define the action on recovery completion
-
saveStateSnapshot
void saveStateSnapshot()
Deprecated.Save the current state as a snapshot
-
receiveCommand
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receiveCommand()
Deprecated.After recovery events are handled as in usual FSM actor- Specified by:
receiveCommand
in interfaceEventsourced
-
receiveRecover
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receiveRecover()
Deprecated.Discover the latest recorded state- Specified by:
receiveRecover
in interfaceEventsourced
- See Also:
Recovery
-
applyState
void applyState(PersistentFSM.State<S,D,E> nextState)
Deprecated.Persist FSM State and FSM State Data- Specified by:
applyState
in interfacePersistentFSMBase<S extends PersistentFSM.FSMState,D,E>
-
-