Package org.apache.pekko.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 Akka 2.6.0.
A FSM implementation with persistent state.
Supports the usual pekko.actor.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 ClassesModifier and TypeInterfaceDescriptionstatic classDeprecated.This extractor is just convenience for matching a (S, S) pair, including a reminder what the new state is.static final classDeprecated.Message type which is sent directly to the subscribed actor inpekko.actor.FSM.SubscribeTransitionCallBackbefore sending anypekko.actor.FSM.Transitionmessages.static classDeprecated.static final classDeprecated.All messages sent to thepekko.actor.FSMwill be wrapped inside anEvent, which allows pattern matching to extract both state and data.static classDeprecated.static final classDeprecated.Signifies that thepekko.actor.FSMis shutting itself down because of an error, e.g.static classDeprecated.static classDeprecated.INTERNAL APIstatic classDeprecated.INTERNAL APIstatic interfaceDeprecated.FSMState base trait, makes possible for simple default serialization by conversion to Stringstatic final classDeprecated.Log Entry of thepekko.actor.LoggingFSM, can be obtained by callinggetLog.static classDeprecated.static classDeprecated.Default reason if callingstop().static classDeprecated.A partial function value which does not match anything and can be used to “reset”whenUnhandledandonTerminationhandlers.static interfaceDeprecated.Base persistent event classstatic classDeprecated.FSM state and data snapshotstatic classDeprecated.static interfaceDeprecated.Reason why thispekko.actor.FSMis shutting down.static classDeprecated.Reason given when someone was callingsystem.stop(fsm)from outside; also applies toStopsupervision directive.static classDeprecated.INTERNAL APIstatic final classDeprecated.This captures all of the managed state of thepekko.actor.FSM: 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 classDeprecated.static classDeprecated.Persisted on state change Not deprecated as used for users migrating from PersistentFSM to EventSourcedBehaviorstatic classDeprecated.static classDeprecated.This case object is received in case of a state timeout.static final classDeprecated.Case class representing the state of thepekko.actor.FSMwhithin theonTerminationblock.static classDeprecated.static final classDeprecated.Send this to anpekko.actor.FSMto request first thePersistentFSM.CurrentStateand then a series ofPersistentFSM.Transitionupdates.static classDeprecated.static final classDeprecated.INTERNAL APIstatic classDeprecated.static final classDeprecated.INTERNAL APIstatic classDeprecated.static interfaceDeprecated.INTERNAL APIstatic final classDeprecated.Message type which is used to communicate transitions between states to all subscribed listeners (usepekko.actor.FSM.SubscribeTransitionCallBack).static classDeprecated.static final classDeprecated.Unsubscribe frompekko.actor.FSM.Transitionnotifications which was effected by sending the correspondingpekko.actor.FSM.SubscribeTransitionCallBack.static classDeprecated.Nested classes/interfaces inherited from interface org.apache.pekko.actor.Actor
Actor.emptyBehavior$, Actor.ignoringBehavior$Nested classes/interfaces inherited from interface org.apache.pekko.persistence.Eventsourced
Eventsourced.AsyncHandlerInvocation, Eventsourced.AsyncHandlerInvocation$, Eventsourced.PendingHandlerInvocation, Eventsourced.RecoveryTick, Eventsourced.RecoveryTick$, Eventsourced.StashingHandlerInvocation, Eventsourced.StashingHandlerInvocation$Nested classes/interfaces inherited from interface org.apache.pekko.persistence.fsm.PersistentFSMBase
PersistentFSMBase.TransformHelper -
Method Summary
Modifier and TypeMethodDescriptionapplyEvent(E domainEvent, D currentData) Deprecated.Override this handler to define the action on Domain EventvoidapplyState(PersistentFSM.State<S, D, E> nextState) Deprecated.Persist FSM State and FSM State DatavoidcurrentStateTimeout_$eq(scala.Option<scala.concurrent.duration.FiniteDuration> x$1) Deprecated.scala.reflect.ClassTag<E>Deprecated.Enables to pass a ClassTag of a domain event base type from the implementing classscala.reflect.ClassTag<E>Deprecated.Domain event'sClassTagUsed for identifying domain events during recoveryvoidDeprecated.Override this handler to define the action on recovery completionvoidorg$apache$pekko$persistence$fsm$PersistentFSM$_setter_$domainEventTag_$eq(scala.reflect.ClassTag<E> x$1) Deprecated.Domain event'sClassTagUsed for identifying domain events during recoveryscala.PartialFunction<Object,scala.runtime.BoxedUnit> Deprecated.After recovery events are handled as in usual FSM actorscala.PartialFunction<Object,scala.runtime.BoxedUnit> Deprecated.Discover the latest recorded statevoidDeprecated.Save the current state as a snapshotDeprecated.Map from state identifier to state instancevoidsuper$applyState(PersistentFSM.State<S, D, E> nextState) Deprecated.Persist FSM State and FSM State DataMethods inherited from interface org.apache.pekko.actor.Actor
context, org$apache$pekko$actor$Actor$_setter_$context_$eq, org$apache$pekko$actor$Actor$_setter_$self_$eq, postRestart, preStart, self, sender, supervisorStrategyMethods inherited from interface org.apache.pekko.actor.ActorLogging
_log_$eq, logMethods inherited from interface org.apache.pekko.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_$eqMethods inherited from interface org.apache.pekko.routing.Listeners
gossip, gossip$default$2, listenerManagement, listeners, org$apache$pekko$routing$Listeners$_setter_$listeners_$eqMethods inherited from interface org.apache.pekko.persistence.PersistenceIdentity
journalPluginId, persistenceId, snapshotPluginIdMethods inherited from interface org.apache.pekko.persistence.PersistenceRecovery
recoveryMethods inherited from interface org.apache.pekko.persistence.PersistenceStash
internalStashOverflowStrategyMethods inherited from interface org.apache.pekko.persistence.PersistentActor
defer, deferAsync, persist, persistAll, persistAllAsync, persistAsync, receiveMethods inherited from interface org.apache.pekko.persistence.fsm.PersistentFSMBase
$minus$greater, cancelTimer, currentState_$eq, debugEvent, Event, generation_$eq, handleEvent_$eq, handleTransition, initialize, isStateTimerActive, isTimerActive, logTermination, makeTransition, nextState_$eq, nextStateData, onTermination, onTransition, org$apache$pekko$persistence$fsm$PersistentFSMBase$_setter_$Event_$eq, org$apache$pekko$persistence$fsm$PersistentFSMBase$_setter_$StateTimeout_$eq, org$apache$pekko$persistence$fsm$PersistentFSMBase$_setter_$StopEvent_$eq, 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, whenUnhandledMethods inherited from interface org.apache.pekko.persistence.Snapshotter
deleteSnapshot, deleteSnapshots, loadSnapshot, saveSnapshotMethods inherited from interface org.apache.pekko.actor.StashFactory
createStashMethods inherited from interface org.apache.pekko.actor.StashSupport
actorCell, clearStash, context, enqueueFirst, mailbox, org$apache$pekko$actor$StashSupport$_setter_$mailbox_$eq, prepend, self, theStash_$eq, unstash, unstashAllMethods inherited from interface org.apache.pekko.actor.UnrestrictedStash
postStop, preRestart, super$postStop, super$preRestart
-
Method Details
-
org$apache$pekko$persistence$fsm$PersistentFSM$_setter_$domainEventTag_$eq
void org$apache$pekko$persistence$fsm$PersistentFSM$_setter_$domainEventTag_$eq(scala.reflect.ClassTag<E> x$1) Deprecated.Domain event'sClassTagUsed for identifying domain events during recovery -
super$applyState
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:
ClassTagof domain event base type
-
domainEventTag
scala.reflect.ClassTag<E> domainEventTag()Deprecated.Domain event'sClassTagUsed for identifying domain events during recovery -
statesMap
Deprecated.Map from state identifier to state instance -
currentStateTimeout_$eq
void currentStateTimeout_$eq(scala.Option<scala.concurrent.duration.FiniteDuration> x$1) Deprecated. -
applyEvent
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<Object,scala.runtime.BoxedUnit> receiveCommand()Deprecated.After recovery events are handled as in usual FSM actor- Specified by:
receiveCommandin interfaceEventsourced
-
receiveRecover
scala.PartialFunction<Object,scala.runtime.BoxedUnit> receiveRecover()Deprecated.Discover the latest recorded state- Specified by:
receiveRecoverin interfaceEventsourced- See Also:
-
pekko.persistence.Recovery
-
applyState
Deprecated.Persist FSM State and FSM State Data- Specified by:
applyStatein interfacePersistentFSMBase<S extends PersistentFSM.FSMState,D, E>
-