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.FSMfunctionality with additional persistence features.PersistentFSMis 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 classPersistentFSM.$minus$greater$Deprecated.This extractor is just convenience for matching a (S, S) pair, including a reminder what the new state is.static classPersistentFSM.CurrentState<S>Deprecated.Message type which is sent directly to the subscribed actor inpekko.actor.FSM.SubscribeTransitionCallBackbefore sending anypekko.actor.FSM.Transitionmessages.static classPersistentFSM.CurrentState$Deprecated.static classPersistentFSM.Event<D>Deprecated.All messages sent to thepekko.actor.FSMwill be wrapped inside anEvent, which allows pattern matching to extract both state and data.static classPersistentFSM.Event$Deprecated.static classPersistentFSM.FailureDeprecated.Signifies that thepekko.actor.FSMis shutting itself down because of an error, e.g.static classPersistentFSM.Failure$Deprecated.static classPersistentFSM.FixedDelayMode$Deprecated.INTERNAL APIstatic classPersistentFSM.FixedRateMode$Deprecated.INTERNAL APIstatic interfacePersistentFSM.FSMStateDeprecated.FSMState base trait, makes possible for simple default serialization by conversion to Stringstatic classPersistentFSM.LogEntry<S,D>Deprecated.Log Entry of thepekko.actor.LoggingFSM, can be obtained by callinggetLog.static classPersistentFSM.LogEntry$Deprecated.static classPersistentFSM.Normal$Deprecated.Default reason if callingstop().static classPersistentFSM.NullFunction$Deprecated.A partial function value which does not match anything and can be used to “reset”whenUnhandledandonTerminationhandlers.static interfacePersistentFSM.PersistentFsmEventDeprecated.Base persistent event classstatic classPersistentFSM.PersistentFSMSnapshot<D>Deprecated.FSM state and data snapshotstatic classPersistentFSM.PersistentFSMSnapshot$Deprecated.static interfacePersistentFSM.ReasonDeprecated.Reason why thispekko.actor.FSMis shutting down.static classPersistentFSM.Shutdown$Deprecated.Reason given when someone was callingsystem.stop(fsm)from outside; also applies toStopsupervision directive.static classPersistentFSM.SingleMode$Deprecated.INTERNAL APIstatic classPersistentFSM.State<S,D,E>Deprecated.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 classPersistentFSM.State$Deprecated.static classPersistentFSM.StateChangeEventDeprecated.Persisted on state change Not deprecated as used for users migrating from PersistentFSM to EventSourcedBehaviorstatic classPersistentFSM.StateChangeEvent$Deprecated.static classPersistentFSM.StateTimeout$Deprecated.This case object is received in case of a state timeout.static classPersistentFSM.StopEvent<S,D>Deprecated.Case class representing the state of thepekko.actor.FSMwhithin theonTerminationblock.static classPersistentFSM.StopEvent$Deprecated.static classPersistentFSM.SubscribeTransitionCallBackDeprecated.Send this to anpekko.actor.FSMto request first thePersistentFSM.CurrentStateand then a series ofPersistentFSM.Transitionupdates.static classPersistentFSM.SubscribeTransitionCallBack$Deprecated.static classPersistentFSM.TimeoutMarkerDeprecated.INTERNAL APIstatic classPersistentFSM.TimeoutMarker$Deprecated.static classPersistentFSM.TimerDeprecated.INTERNAL APIstatic classPersistentFSM.Timer$Deprecated.static interfacePersistentFSM.TimerModeDeprecated.INTERNAL APIstatic classPersistentFSM.Transition<S>Deprecated.Message type which is used to communicate transitions between states to all subscribed listeners (usepekko.actor.FSM.SubscribeTransitionCallBack).static classPersistentFSM.Transition$Deprecated.static classPersistentFSM.UnsubscribeTransitionCallBackDeprecated.Unsubscribe frompekko.actor.FSM.Transitionnotifications which was effected by sending the correspondingpekko.actor.FSM.SubscribeTransitionCallBack.static classPersistentFSM.UnsubscribeTransitionCallBack$Deprecated.-
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
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description DapplyEvent(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>domainEventClassTag()Deprecated.Enables to pass a ClassTag of a domain event base type from the implementing classscala.reflect.ClassTag<E>domainEventTag()Deprecated.Domain event'sClassTagUsed for identifying domain events during recoveryvoidonRecoveryCompleted()Deprecated.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<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 statevoidsaveStateSnapshot()Deprecated.Save the current state as a snapshotscala.collection.immutable.Map<java.lang.String,S>statesMap()Deprecated.Map from state identifier to state instancevoidsuper$applyState(PersistentFSM.State<S,D,E> nextState)Deprecated.Persist FSM State and FSM State Data-
Methods 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, supervisorStrategy
-
Methods inherited from interface org.apache.pekko.actor.ActorLogging
_log_$eq, log
-
Methods 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_$eq
-
Methods inherited from interface org.apache.pekko.routing.Listeners
gossip, gossip$default$2, listenerManagement, listeners, org$apache$pekko$routing$Listeners$_setter_$listeners_$eq
-
Methods inherited from interface org.apache.pekko.persistence.PersistenceIdentity
journalPluginId, persistenceId, snapshotPluginId
-
Methods inherited from interface org.apache.pekko.persistence.PersistenceRecovery
recovery
-
Methods inherited from interface org.apache.pekko.persistence.PersistenceStash
internalStashOverflowStrategy
-
Methods inherited from interface org.apache.pekko.persistence.PersistentActor
defer, deferAsync, persist, persistAll, persistAllAsync, persistAsync, receive
-
Methods 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, whenUnhandled
-
Methods inherited from interface org.apache.pekko.persistence.Snapshotter
deleteSnapshot, deleteSnapshots, loadSnapshot, saveSnapshot
-
Methods inherited from interface org.apache.pekko.actor.StashFactory
createStash
-
Methods 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, unstashAll
-
Methods inherited from interface org.apache.pekko.actor.UnrestrictedStash
postStop, preRestart, super$postStop, super$preRestart
-
-
-
-
Method Detail
-
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
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:
ClassTagof domain event base type
-
domainEventTag
scala.reflect.ClassTag<E> domainEventTag()
Deprecated.Domain event'sClassTagUsed 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:
receiveCommandin interfaceEventsourced
-
receiveRecover
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receiveRecover()
Deprecated.Discover the latest recorded state- Specified by:
receiveRecoverin interfaceEventsourced- See Also:
pekko.persistence.Recovery
-
applyState
void applyState(PersistentFSM.State<S,D,E> nextState)
Deprecated.Persist FSM State and FSM State Data- Specified by:
applyStatein interfacePersistentFSMBase<S extends PersistentFSM.FSMState,D,E>
-
-