akka.persistence
Interface Eventsourced

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

public interface Eventsourced
extends ProcessorImpl

INTERNAL API.

Event sourcing mixin for a Processor.


Nested Class Summary
private static class Eventsourced.AsyncHandlerInvocation
           
static interface Eventsourced.PendingHandlerInvocation
           
private static class Eventsourced.StashingHandlerInvocation
           
 
Nested classes/interfaces inherited from interface akka.persistence.Recovery
Recovery.State
 
Nested classes/interfaces inherited from interface akka.actor.Actor
Actor.emptyBehavior$
 
Method Summary
 void aroundPreRestart(java.lang.Throwable reason, scala.Option<java.lang.Object> message)
          INTERNAL API.
 void aroundReceive(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive, java.lang.Object message)
          INTERNAL API.
 Recovery.State currentState()
           
<A> void
defer(A event, scala.Function1<A,scala.runtime.BoxedUnit> handler)
           
<A> void
defer(scala.collection.immutable.Seq<A> events, scala.Function1<A,scala.runtime.BoxedUnit> handler)
           
 void flushBatch()
           
 scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> initialBehavior()
          INTERNAL API.
 java.util.LinkedList<Eventsourced.PendingHandlerInvocation> pendingInvocations()
           
 long pendingStashingPersistInvocations()
           
<A> void
persist(A event, scala.Function1<A,scala.runtime.BoxedUnit> handler)
           
<A> void
persist(scala.collection.immutable.Seq<A> events, scala.Function1<A,scala.runtime.BoxedUnit> handler)
           
<A> void
persistAsync(A event, scala.Function1<A,scala.runtime.BoxedUnit> handler)
           
<A> void
persistAsync(scala.collection.immutable.Seq<A> events, scala.Function1<A,scala.runtime.BoxedUnit> handler)
           
 Recovery.State persistingEvents()
          Event persisting state.
 void postStop()
          User overridable callback.
 void preRestart(java.lang.Throwable reason, scala.Option<java.lang.Object> message)
          User-overridable callback.
 Recovery.State processingCommands()
          Command processing state.
 StashSupport processorStash()
           
 scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receiveCommand()
           
 scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receiveRecover()
           
 Recovery.State recovering()
          Processor recovery state.
 scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> recoveryBehavior()
          INTERNAL API.
 scala.collection.immutable.List<Resequenceable> resequenceableEventBatch()
           
 void unstashAll()
          Prepends all messages in the stash to the mailbox, and then clears the stash.
 boolean useProcessorBatching()
           
 
Methods inherited from interface akka.persistence.ProcessorImpl
_persistenceId, aroundPostStop, aroundPreStart, deleteMessage, deleteMessage, deleteMessages, deleteMessages, flushJournalBatch, initializing, instanceId, nextSequenceNr, onRecoveryCompleted, onRecoveryFailure, onReplayFailure, onReplaySuccess, preRestartDefault, preStart, processing, processorBatch, processorId, recoveryFinished, recoveryRunning, sequenceNr, snapshotterId, unhandled, unstashFilterPredicate
 
Methods inherited from interface akka.persistence.Recovery
_currentPersistent, _currentState, _lastSequenceNr, _recoveryFailureCause, _recoveryFailureMessage, 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.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
 
Methods inherited from interface akka.actor.StashFactory
createStash
 

Method Detail

recovering

Recovery.State recovering()
Processor recovery state. Waits for recovery completion and then changes to processingCommands

Returns:
(undocumented)

processingCommands

Recovery.State processingCommands()
Command processing state. If event persistence is pending after processing a command, event persistence is triggered and state changes to persistingEvents.

There's no need to loop commands though the journal any more i.e. they can now be directly offered as LoopSuccess to the state machine implemented by Processor.

Returns:
(undocumented)

persistingEvents

Recovery.State persistingEvents()
Event persisting state. Remains until pending events are persisted and then changes state to processingCommands. Only events to be persisted are processed. All other messages are stashed internally.

Returns:
(undocumented)

recoveryBehavior

scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> recoveryBehavior()
INTERNAL API.

This is a def and not a val because of binary compatibility in 2.3.x. It is cached where it is used.

Returns:
(undocumented)

pendingStashingPersistInvocations

long pendingStashingPersistInvocations()

pendingInvocations

java.util.LinkedList<Eventsourced.PendingHandlerInvocation> pendingInvocations()

resequenceableEventBatch

scala.collection.immutable.List<Resequenceable> resequenceableEventBatch()

useProcessorBatching

boolean useProcessorBatching()

currentState

Recovery.State currentState()

processorStash

StashSupport processorStash()

flushBatch

void flushBatch()

persist

<A> void persist(A event,
                 scala.Function1<A,scala.runtime.BoxedUnit> handler)

persist

<A> void persist(scala.collection.immutable.Seq<A> events,
                 scala.Function1<A,scala.runtime.BoxedUnit> handler)

persistAsync

<A> void persistAsync(A event,
                      scala.Function1<A,scala.runtime.BoxedUnit> handler)

persistAsync

<A> void persistAsync(scala.collection.immutable.Seq<A> events,
                      scala.Function1<A,scala.runtime.BoxedUnit> handler)

defer

<A> void defer(A event,
               scala.Function1<A,scala.runtime.BoxedUnit> handler)

defer

<A> void defer(scala.collection.immutable.Seq<A> events,
               scala.Function1<A,scala.runtime.BoxedUnit> handler)

receiveRecover

scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receiveRecover()

receiveCommand

scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receiveCommand()

unstashAll

void unstashAll()
Description copied from interface: StashSupport
Prepends all messages in the stash to the mailbox, and then clears the stash.

Messages from the stash are enqueued to the mailbox until the capacity of the mailbox (if any) has been reached. In case a bounded mailbox overflows, a MessageQueueAppendFailedException is thrown.

The stash is guaranteed to be empty after calling unstashAll().

Specified by:
unstashAll in interface StashSupport

aroundReceive

void aroundReceive(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive,
                   java.lang.Object message)
Description copied from interface: Actor
INTERNAL API.

Can be overridden to intercept calls to this actor's current behavior.

Specified by:
aroundReceive in interface Actor
Specified by:
aroundReceive in interface Recovery
Parameters:
receive - current behavior.
message - current message.

aroundPreRestart

void aroundPreRestart(java.lang.Throwable reason,
                      scala.Option<java.lang.Object> message)
Description copied from interface: ProcessorImpl
INTERNAL API.

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

preRestart

void preRestart(java.lang.Throwable reason,
                scala.Option<java.lang.Object> message)
Description copied from interface: ProcessorImpl
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 ProcessorImpl
Specified by:
preRestart in interface UnrestrictedStash
Parameters:
reason - (undocumented)
message - (undocumented)

postStop

void postStop()
Description copied from interface: Actor
User overridable callback.

Is called asynchronously after 'actor.stop()' is invoked. Empty default implementation.

Specified by:
postStop in interface Actor
Specified by:
postStop in interface UnrestrictedStash

initialBehavior

scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> initialBehavior()
INTERNAL API.

Only here for binary compatibility in 2.3.x.

Returns:
(undocumented)