Package org.apache.pekko.persistence.fsm
Class PersistentFSM.State<S,D,E>
java.lang.Object
org.apache.pekko.persistence.fsm.PersistentFSM.State<S,D,E>
- All Implemented Interfaces:
Serializable,scala.Equals,scala.Product
- Enclosing interface:
- PersistentFSM<S extends PersistentFSM.FSMState,
D, E>
public static final class PersistentFSM.State<S,D,E>
extends Object
implements scala.Product, Serializable
This captures all of the managed state of the
pekko.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)- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionState(S stateName, D stateData, scala.Option<scala.concurrent.duration.FiniteDuration> timeout, scala.Option<PersistentFSM.Reason> stopReason, scala.collection.immutable.List<Object> replies, scala.collection.immutable.Seq<E> domainEvents, scala.Function1<D, scala.runtime.BoxedUnit> afterTransitionDo, boolean notifies) -
Method Summary
Modifier and TypeMethodDescriptionscala.Function1<D,scala.runtime.BoxedUnit> Register a handler to be triggered after the state has been persisted successfullySpecify domain events to be applied when transitioning to the new state.Specify domain events to be applied when transitioning to the new state.boolean<S,D, E> PersistentFSM.State<S, D, E> copy(S stateName, D stateData, scala.Option<scala.concurrent.duration.FiniteDuration> timeout, scala.Option<PersistentFSM.Reason> stopReason, scala.collection.immutable.List<Object> replies, scala.collection.immutable.Seq<E> domainEvents, scala.Function1<D, scala.runtime.BoxedUnit> afterTransitionDo, boolean notifies) <S,D, E> S <S,D, E> D <S,D, E> scala.Option<scala.concurrent.duration.FiniteDuration> <S,D, E> scala.Option<PersistentFSM.Reason> <S,D, E> scala.collection.immutable.List<Object> <S,D, E> scala.collection.immutable.Seq<E> <S,D, E> scala.Function1<D, scala.runtime.BoxedUnit> scala.collection.immutable.Seq<E>booleanJava API: Modify state transition descriptor to include a state timeout for the next state.forMax(scala.concurrent.duration.Duration timeout) Modify state transition descriptor to include a state timeout for the next state.inthashCode()intproductElement(int x$1) productElementName(int x$1) scala.collection.Iterator<Object>scala.collection.immutable.List<Object>replies()Send reply to sender of the current message, if available.scala.Option<PersistentFSM.Reason>scala.Option<scala.concurrent.duration.FiniteDuration>timeout()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface scala.Product
productElementNames
-
Constructor Details
-
State
public State(S stateName, D stateData, scala.Option<scala.concurrent.duration.FiniteDuration> timeout, scala.Option<PersistentFSM.Reason> stopReason, scala.collection.immutable.List<Object> replies, scala.collection.immutable.Seq<E> domainEvents, scala.Function1<D, scala.runtime.BoxedUnit> afterTransitionDo, boolean notifies)
-
-
Method Details
-
applying
Specify domain events to be applied when transitioning to the new state. -
stateName
-
stateData
-
timeout
public scala.Option<scala.concurrent.duration.FiniteDuration> timeout() -
stopReason
-
replies
-
domainEvents
-
afterTransitionDo
-
forMax
Modify state transition descriptor to include a state timeout for the next state. This timeout overrides any default timeout set for the next state.Use Duration.Inf to deactivate an existing timeout.
-
forMax
Java API: Modify state transition descriptor to include a state timeout for the next state. This timeout overrides any default timeout set for the next state.Use Duration.Inf to deactivate an existing timeout.
-
replying
Send reply to sender of the current message, if available.- Returns:
- this state transition descriptor
-
applying
Specify domain events to be applied when transitioning to the new state. -
andThen
Register a handler to be triggered after the state has been persisted successfully -
copy
public <S,D, PersistentFSM.State<S,E> D, copyE> (S stateName, D stateData, scala.Option<scala.concurrent.duration.FiniteDuration> timeout, scala.Option<PersistentFSM.Reason> stopReason, scala.collection.immutable.List<Object> replies, scala.collection.immutable.Seq<E> domainEvents, scala.Function1<D, scala.runtime.BoxedUnit> afterTransitionDo, boolean notifies) -
copy$default$1
public <S,D, S copy$default$1()E> -
copy$default$2
public <S,D, D copy$default$2()E> -
copy$default$3
public <S,D, scala.Option<scala.concurrent.duration.FiniteDuration> copy$default$3()E> -
copy$default$4
-
copy$default$5
-
copy$default$6
public <S,D, scala.collection.immutable.Seq<E> copy$default$6()E> -
copy$default$7
public <S,D, scala.Function1<D,E> scala.runtime.BoxedUnit> copy$default$7() -
productPrefix
- Specified by:
productPrefixin interfacescala.Product
-
productArity
public int productArity()- Specified by:
productArityin interfacescala.Product
-
productElement
- Specified by:
productElementin interfacescala.Product
-
productIterator
- Specified by:
productIteratorin interfacescala.Product
-
canEqual
- Specified by:
canEqualin interfacescala.Equals
-
productElementName
- Specified by:
productElementNamein interfacescala.Product
-
hashCode
public int hashCode() -
toString
-
equals
-