akka.persistence
Interface ProcessorImpl

All Superinterfaces:
Actor, Recovery, RequiresMessageQueue<DequeBasedMessageQueueSemantics>, Snapshotter, Stash, StashFactory, StashSupport, UnrestrictedStash
All Known Subinterfaces:
AtLeastOnceDelivery, Eventsourced, EventsourcedProcessor, PersistentActor, Processor
All Known Implementing Classes:
AbstractEventsourcedProcessor, AbstractPersistentActor, AbstractPersistentActorWithAtLeastOnceDelivery, AbstractProcessor, JournalPerfSpec.BenchActor, RequestWriter, ShardCoordinator, UntypedEventsourcedProcessor, UntypedPersistentActor, UntypedPersistentActorWithAtLeastOnceDelivery, UntypedProcessor

public interface ProcessorImpl
extends Actor, Recovery

INTERNAL API


Nested Class Summary
 
Nested classes/interfaces inherited from interface akka.persistence.Recovery
Recovery.State
 
Nested classes/interfaces inherited from interface akka.actor.Actor
Actor.emptyBehavior$
 
Method Summary
 java.lang.String _persistenceId()
           
 void aroundPostStop()
          INTERNAL API.
 void aroundPreRestart(java.lang.Throwable reason, scala.Option<java.lang.Object> message)
          INTERNAL API.
 void aroundPreStart()
          INTERNAL API.
 void deleteMessage(long sequenceNr)
          Marks a persistent message, identified by sequenceNr, as deleted.
 void deleteMessage(long sequenceNr, boolean permanent)
          Deletes a persistent message identified by sequenceNr.
 void deleteMessages(long toSequenceNr)
          Permanently deletes all persistent messages with sequence numbers less than or equal toSequenceNr.
 void deleteMessages(long toSequenceNr, boolean permanent)
          Deletes all persistent messages with sequence numbers less than or equal toSequenceNr.
 void flushJournalBatch()
          INTERNAL API
 java.lang.Object initializing()
          Processes the highest stored sequence number response from the journal and then switches to processing state.
 int instanceId()
           
 long nextSequenceNr()
           
 void onRecoveryCompleted(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive)
          Invokes this processor's behavior with a RecoveryFinished message.
 void onRecoveryFailure(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive, java.lang.Throwable cause)
          Invokes this processor's behavior with a RecoveryFailure message.
 void onReplayFailure(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive, boolean awaitReplay, java.lang.Throwable cause)
          INTERNAL API.
 void onReplaySuccess(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive, boolean awaitReplay)
          INTERNAL API.
 void preRestart(java.lang.Throwable reason, scala.Option<java.lang.Object> message)
          User-overridable callback.
 void preRestartDefault(java.lang.Throwable reason, scala.Option<java.lang.Object> message)
          Calls preRestart and then super.preRestart().
 void preStart()
          User-overridable callback.
 java.lang.Object processing()
          Journals and processes new messages, both persistent and transient.
 scala.collection.immutable.Vector<Resequenceable> processorBatch()
           
 java.lang.String processorId()
          Processor id.
 boolean recoveryFinished()
          Returns true if this processor has successfully finished recovery.
 boolean recoveryRunning()
          Returns true if this processor is currently recovering.
 long sequenceNr()
           
 java.lang.String snapshotterId()
          Returns persistenceId.
 void unhandled(java.lang.Object message)
          User overridable callback.
 scala.Function1<java.lang.Object,java.lang.Object> unstashFilterPredicate()
           
 
Methods inherited from interface akka.persistence.Recovery
_currentPersistent, _currentState, _lastSequenceNr, _recoveryFailureCause, _recoveryFailureMessage, aroundReceive, currentPersistentMessage, extension, getCurrentPersistentMessage, journal, lastSequenceNr, persistenceId, prepareRestart, receiverStash, recoveryPending, recoveryStarted, replayFailed, replayStarted, runReceive, snapshotSequenceNr, updateLastSequenceNr, updateLastSequenceNr, withCurrentPersistent
 
Methods inherited from interface akka.persistence.Snapshotter
deleteSnapshot, deleteSnapshots, loadSnapshot, saveSnapshot, snapshotStore
 
Methods inherited from interface akka.actor.UnrestrictedStash
postStop
 
Methods inherited from interface akka.actor.Actor
aroundPostRestart, context, postRestart, receive, self, sender, supervisorStrategy
 
Methods inherited from interface akka.actor.StashSupport
actorCell, capacity, clearStash, context, enqueueFirst, mailbox, prepend, self, stash, theStash, unstash, unstashAll, unstashAll
 
Methods inherited from interface akka.actor.StashFactory
createStash
 

Method Detail

instanceId

int instanceId()

initializing

java.lang.Object initializing()
Processes the highest stored sequence number response from the journal and then switches to processing state.

Returns:
(undocumented)

processing

java.lang.Object processing()
Journals and processes new messages, both persistent and transient.

Returns:
(undocumented)

onReplaySuccess

void onReplaySuccess(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive,
                     boolean awaitReplay)
INTERNAL API.

Switches to initializing state and requests the highest stored sequence number from the journal.

Specified by:
onReplaySuccess in interface Recovery
Parameters:
receive - (undocumented)
awaitReplay - (undocumented)

onReplayFailure

void onReplayFailure(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive,
                     boolean awaitReplay,
                     java.lang.Throwable cause)
INTERNAL API.

Specified by:
onReplayFailure in interface Recovery
Parameters:
receive - (undocumented)
awaitReplay - (undocumented)
cause - (undocumented)

onRecoveryFailure

void onRecoveryFailure(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive,
                       java.lang.Throwable cause)
Invokes this processor's behavior with a RecoveryFailure message.

Parameters:
receive - (undocumented)
cause - (undocumented)

onRecoveryCompleted

void onRecoveryCompleted(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive)
Invokes this processor's behavior with a RecoveryFinished message.

Parameters:
receive - (undocumented)

_persistenceId

java.lang.String _persistenceId()

processorBatch

scala.collection.immutable.Vector<Resequenceable> processorBatch()

sequenceNr

long sequenceNr()

processorId

java.lang.String processorId()
Processor id. Defaults to this processor's path and can be overridden.

Specified by:
processorId in interface Recovery
Returns:
(undocumented)

snapshotterId

java.lang.String snapshotterId()
Returns persistenceId.

Specified by:
snapshotterId in interface Snapshotter
Returns:
(undocumented)

recoveryRunning

boolean recoveryRunning()
Returns true if this processor is currently recovering.

Returns:
(undocumented)

recoveryFinished

boolean recoveryFinished()
Returns true if this processor has successfully finished recovery.

Returns:
(undocumented)

deleteMessage

void deleteMessage(long sequenceNr)
Marks a persistent message, identified by sequenceNr, as deleted. A message marked as deleted is not replayed during recovery. This method is usually called inside preRestartProcessor when a persistent message caused an exception. Processors that want to re-receive that persistent message during recovery should not call this method.

Parameters:
sequenceNr - sequence number of the persistent message to be deleted.

deleteMessage

void deleteMessage(long sequenceNr,
                   boolean permanent)
Deletes a persistent message identified by sequenceNr. If permanent is set to false, the persistent message is marked as deleted in the journal, otherwise it is permanently deleted from the journal. A deleted message is not replayed during recovery. This method is usually called inside preRestartProcessor when a persistent message caused an exception. Processors that want to re-receive that persistent message during recovery should not call this method.

Parameters:
sequenceNr - sequence number of the persistent message to be deleted.
permanent - if false, the message is marked as deleted, otherwise it is permanently deleted.

deleteMessages

void deleteMessages(long toSequenceNr)
Permanently deletes all persistent messages with sequence numbers less than or equal toSequenceNr.

Parameters:
toSequenceNr - upper sequence number bound of persistent messages to be deleted.

deleteMessages

void deleteMessages(long toSequenceNr,
                    boolean permanent)
Deletes all persistent messages with sequence numbers less than or equal toSequenceNr. If permanent is set to false, the persistent messages are marked as deleted in the journal, otherwise they permanently deleted from the journal.

Parameters:
toSequenceNr - upper sequence number bound of persistent messages to be deleted.
permanent - if false, the message is marked as deleted, otherwise it is permanently deleted.

flushJournalBatch

void flushJournalBatch()
INTERNAL API


aroundPreStart

void aroundPreStart()
INTERNAL API.

Specified by:
aroundPreStart in interface Actor

aroundPostStop

void aroundPostStop()
INTERNAL API.

Specified by:
aroundPostStop in interface Actor

aroundPreRestart

void aroundPreRestart(java.lang.Throwable reason,
                      scala.Option<java.lang.Object> message)
INTERNAL API.

Specified by:
aroundPreRestart in interface Actor
Parameters:
reason - (undocumented)
message - (undocumented)

preStart

void preStart()
User-overridable callback. Called when a processor is started. Default implementation sends a Recover() to self.

Specified by:
preStart in interface Actor

preRestart

void preRestart(java.lang.Throwable reason,
                scala.Option<java.lang.Object> message)
User-overridable callback. Called before a processor is restarted. Default implementation sends a Recover(lastSequenceNr) message to self if message is defined, Recover() otherwise.

Specified by:
preRestart in interface Actor
Specified by:
preRestart in interface UnrestrictedStash
Parameters:
reason - (undocumented)
message - (undocumented)

preRestartDefault

void preRestartDefault(java.lang.Throwable reason,
                       scala.Option<java.lang.Object> message)
Calls preRestart and then super.preRestart(). If processor implementation classes want to opt out from stopping child actors, they should override this method and call preRestart only.

Parameters:
reason - (undocumented)
message - (undocumented)

unhandled

void unhandled(java.lang.Object message)
Description copied from interface: Actor
User overridable callback.

Is called when a message isn't handled by the current behavior of the actor by default it fails with either a DeathPactException (in case of an unhandled Terminated message) or publishes an UnhandledMessage to the actor's system's EventStream

Specified by:
unhandled in interface Actor
Parameters:
message - (undocumented)

nextSequenceNr

long nextSequenceNr()

unstashFilterPredicate

scala.Function1<java.lang.Object,java.lang.Object> unstashFilterPredicate()