Package org.apache.pekko.persistence
Class AbstractPersistentActor
- java.lang.Object
- 
- org.apache.pekko.actor.AbstractActor
- 
- org.apache.pekko.persistence.AbstractPersistentActor
 
 
- 
- All Implemented Interfaces:
- Actor,- Stash,- StashFactory,- StashSupport,- UnrestrictedStash,- RequiresMessageQueue<DequeBasedMessageQueueSemantics>,- AbstractPersistentActorLike,- Eventsourced,- PersistenceIdentity,- PersistenceRecovery,- PersistenceStash,- Snapshotter
 - Direct Known Subclasses:
- AbstractPersistentActorWithAtLeastOnceDelivery
 
 public abstract class AbstractPersistentActor extends AbstractActor implements AbstractPersistentActorLike Java API: an persistent actor - can be used to implement command or Event Sourcing.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.apache.pekko.actor.AbstractActorAbstractActor.ActorContext, AbstractActor.Receive
 - 
Nested classes/interfaces inherited from interface org.apache.pekko.actor.ActorActor.emptyBehavior$, Actor.ignoringBehavior$
 - 
Nested classes/interfaces inherited from interface org.apache.pekko.persistence.EventsourcedEventsourced.AsyncHandlerInvocation, Eventsourced.AsyncHandlerInvocation$, Eventsourced.PendingHandlerInvocation, Eventsourced.RecoveryTick, Eventsourced.RecoveryTick$, Eventsourced.StashingHandlerInvocation, Eventsourced.StashingHandlerInvocation$, Eventsourced.State
 
- 
 - 
Constructor SummaryConstructors Constructor Description AbstractPersistentActor()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract AbstractActor.ReceivecreateReceive()An persistent actor has to define its initial receive behavior by implementing thecreateReceivemethod, also known as the command handler.abstract AbstractActor.ReceivecreateReceiveRecover()Recovery handler that receives persisted events during recovery.protected ActorRefjournal()protected voidorg$apache$pekko$actor$StashSupport$_setter_$mailbox_$eq(DequeBasedMessageQueueSemantics x$1)protected ActorRefsnapshotStore()Snapshot store plugin actor.- 
Methods inherited from class org.apache.pekko.actor.AbstractActorcontext, emptyBehavior, getContext, getSelf, getSender, org$apache$pekko$actor$Actor$_setter_$context_$eq, org$apache$pekko$actor$Actor$_setter_$self_$eq, postRestart, postStop, preRestart, preRestart, preStart, receive, receiveBuilder, self, supervisorStrategy
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.pekko.persistence.AbstractPersistentActorLikedefer, deferAsync, persist, persistAll, persistAllAsync, persistAsync, receiveCommand, receiveRecover
 - 
Methods inherited from interface org.apache.pekko.actor.Actorcontext, org$apache$pekko$actor$Actor$_setter_$context_$eq, org$apache$pekko$actor$Actor$_setter_$self_$eq, postRestart, preStart, receive, self, sender, supervisorStrategy
 - 
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, journalBatch_$eq, lastSequenceNr, log, nextSequenceNr, onPersistFailure, onPersistRejected, onRecoveryFailure, onReplaySuccess, peekApplyHandler, pendingStashingPersistInvocations_$eq, recovering, recoveryFinished, recoveryRunning, recoveryStarted, requestRecoveryPermit, sendBatchedEventsToJournal, sequenceNr_$eq, setLastSequenceNr, snapshotSequenceNr, 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.persistence.PersistenceIdentityjournalPluginId, persistenceId, snapshotPluginId
 - 
Methods inherited from interface org.apache.pekko.persistence.PersistenceRecoveryrecovery
 - 
Methods inherited from interface org.apache.pekko.persistence.PersistenceStashinternalStashOverflowStrategy
 - 
Methods inherited from interface org.apache.pekko.persistence.SnapshotterdeleteSnapshot, deleteSnapshots, loadSnapshot, saveSnapshot
 - 
Methods inherited from interface org.apache.pekko.actor.StashFactorycreateStash
 - 
Methods inherited from interface org.apache.pekko.actor.StashSupportactorCell, clearStash, context, enqueueFirst, prepend, self, theStash_$eq, unstash, unstashAll
 - 
Methods inherited from interface org.apache.pekko.actor.UnrestrictedStashpostStop, preRestart, super$postStop, super$preRestart
 
- 
 
- 
- 
- 
Method Detail- 
createReceivepublic abstract AbstractActor.Receive createReceive() An persistent actor has to define its initial receive behavior by implementing thecreateReceivemethod, also known as the command handler. Typically validates commands against current state (and/or by communication with other actors). On successful validation, one or more events are derived from a command and these events are then persisted by callingpersist.- Specified by:
- createReceivein interface- AbstractPersistentActorLike
- Specified by:
- createReceivein class- AbstractActor
 
 - 
createReceiveRecoverpublic abstract AbstractActor.Receive createReceiveRecover() Recovery handler that receives persisted events during recovery. If a state snapshot has been captured and saved, this handler will receive aSnapshotOffermessage followed by events that are younger than the offered snapshot.This handler must not have side-effects other than changing persistent actor state i.e. it should not perform actions that may fail, such as interacting with external services, for example. If there is a problem with recovering the state of the actor from the journal, the error will be logged and the actor will be stopped. - Specified by:
- createReceiveRecoverin interface- AbstractPersistentActorLike
- See Also:
- Recovery
 
 - 
journalprotected ActorRef journal() - Specified by:
- journalin interface- Eventsourced
 
 - 
org$apache$pekko$actor$StashSupport$_setter_$mailbox_$eqprotected void org$apache$pekko$actor$StashSupport$_setter_$mailbox_$eq(DequeBasedMessageQueueSemantics x$1) - Specified by:
- org$apache$pekko$actor$StashSupport$_setter_$mailbox_$eqin interface- StashSupport
 
 - 
snapshotStoreprotected ActorRef snapshotStore() Description copied from interface:SnapshotterSnapshot store plugin actor.- Specified by:
- snapshotStorein interface- Eventsourced
- Specified by:
- snapshotStorein interface- Snapshotter
 
 
- 
 
-