Package akka.persistence.typed.internal
Class BehaviorSetup<C,E,S>
- java.lang.Object
-
- akka.persistence.typed.internal.BehaviorSetup<C,E,S>
-
public final class BehaviorSetup<C,E,S> extends java.lang.Object
INTERNAL API: Carry state for the Persistent behavior implementation behaviors.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BehaviorSetup.NoSnapshot$
static interface
BehaviorSetup.SnapshotAfterPersist
static class
BehaviorSetup.SnapshotWithoutRetention$
static class
BehaviorSetup.SnapshotWithRetention$
-
Constructor Summary
Constructors Constructor Description BehaviorSetup(ActorContext<InternalProtocol> context, PersistenceId persistenceId, S emptyState, scala.Function2<S,C,Effect<E,S>> commandHandler, scala.Function2<S,E,S> eventHandler, EventSourcedBehaviorImpl.WriterIdentity writerIdentity, scala.PartialFunction<scala.Tuple2<S,Signal>,scala.runtime.BoxedUnit> signalHandler, scala.Function1<E,scala.collection.immutable.Set<java.lang.String>> tagger, EventAdapter<E,java.lang.Object> eventAdapter, SnapshotAdapter<S> snapshotAdapter, scala.Function3<S,E,java.lang.Object,java.lang.Object> snapshotWhen, Recovery recovery, RetentionCriteria retention, boolean holdingRecoveryPermit, EventSourcedSettings settings, StashState stashState, scala.Option<ReplicationSetup> replication, boolean publishEvents, scala.Function0<org.slf4j.Logger> internalLoggerFactory)
-
Method Summary
-
-
-
Constructor Detail
-
BehaviorSetup
public BehaviorSetup(ActorContext<InternalProtocol> context, PersistenceId persistenceId, S emptyState, scala.Function2<S,C,Effect<E,S>> commandHandler, scala.Function2<S,E,S> eventHandler, EventSourcedBehaviorImpl.WriterIdentity writerIdentity, scala.PartialFunction<scala.Tuple2<S,Signal>,scala.runtime.BoxedUnit> signalHandler, scala.Function1<E,scala.collection.immutable.Set<java.lang.String>> tagger, EventAdapter<E,java.lang.Object> eventAdapter, SnapshotAdapter<S> snapshotAdapter, scala.Function3<S,E,java.lang.Object,java.lang.Object> snapshotWhen, Recovery recovery, RetentionCriteria retention, boolean holdingRecoveryPermit, EventSourcedSettings settings, StashState stashState, scala.Option<ReplicationSetup> replication, boolean publishEvents, scala.Function0<org.slf4j.Logger> internalLoggerFactory)
-
-
Method Detail
-
context
public ActorContext<InternalProtocol> context()
-
persistenceId
public PersistenceId persistenceId()
-
emptyState
public S emptyState()
-
writerIdentity
public EventSourcedBehaviorImpl.WriterIdentity writerIdentity()
-
tagger
public scala.Function1<E,scala.collection.immutable.Set<java.lang.String>> tagger()
-
eventAdapter
public EventAdapter<E,java.lang.Object> eventAdapter()
-
snapshotAdapter
public SnapshotAdapter<S> snapshotAdapter()
-
recovery
public Recovery recovery()
-
retention
public RetentionCriteria retention()
-
holdingRecoveryPermit
public boolean holdingRecoveryPermit()
-
holdingRecoveryPermit_$eq
public void holdingRecoveryPermit_$eq(boolean x$1)
-
settings
public EventSourcedSettings settings()
-
stashState
public StashState stashState()
-
replication
public scala.Option<ReplicationSetup> replication()
-
publishEvents
public boolean publishEvents()
-
persistence
public Persistence persistence()
-
journal
public ActorRef journal()
-
snapshotStore
public ActorRef snapshotStore()
-
isSnapshotOptional
public boolean isSnapshotOptional()
-
replicaId
public scala.Option<ReplicaId> replicaId()
-
selfClassic
public ActorRef selfClassic()
-
internalLogger
public org.slf4j.Logger internalLogger()
-
setMdcPhase
public BehaviorSetup<C,E,S> setMdcPhase(java.lang.String phaseName)
-
startRecoveryTimer
public void startRecoveryTimer(boolean snapshot)
-
cancelRecoveryTimer
public void cancelRecoveryTimer()
-
onSignal
public <T> boolean onSignal(S state, Signal signal, boolean catchAndLog)
Applies thesignalHandler
if defined and returns true, otherwise returns false. If an exception is thrown andcatchAndLog=true
it is logged and returns true, otherwise it is thrown.catchAndLog=true
should be used for "unknown" signals in the phases before Running to avoid restart loops if restart supervision is used.
-
shouldSnapshot
public BehaviorSetup.SnapshotAfterPersist shouldSnapshot(S state, E event, long sequenceNr)
-
-