public static final class PersistentFSM.State<S,D,E>
extends java.lang.Object
implements scala.Product, scala.Serializable
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)Constructor and Description |
---|
State(S stateName,
D stateData,
scala.Option<scala.concurrent.duration.FiniteDuration> timeout,
scala.Option<PersistentFSM.Reason> stopReason,
scala.collection.immutable.List<java.lang.Object> replies,
scala.collection.Seq<E> domainEvents,
scala.Function1<D,scala.runtime.BoxedUnit> afterTransitionDo,
boolean notifies) |
Modifier and Type | Method and Description |
---|---|
scala.Function1<D,scala.runtime.BoxedUnit> |
afterTransitionDo() |
PersistentFSM.State<S,D,E> |
andThen(scala.Function1<D,scala.runtime.BoxedUnit> handler)
Register a handler to be triggered after the state has been persisted successfully
|
PersistentFSM.State<S,D,E> |
applying(java.lang.Object... events)
Specify domain events to be applied when transitioning to the new state.
|
PersistentFSM.State<S,D,E> |
applying(scala.collection.Seq<E> events)
Specify domain events to be applied when transitioning to the new state.
|
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<java.lang.Object> replies,
boolean notifies,
scala.collection.Seq<E> domainEvents,
scala.Function1<D,scala.runtime.BoxedUnit> afterTransitionDo)
Copy object and update values if needed.
|
scala.collection.Seq<E> |
domainEvents() |
PersistentFSM.State<S,D,E> |
forMax(scala.concurrent.duration.Duration timeout)
Modify state transition descriptor to include a state timeout for the
next state.
|
boolean |
notifies() |
scala.collection.immutable.List<java.lang.Object> |
replies() |
PersistentFSM.State<S,D,E> |
replying(java.lang.Object replyValue)
Send reply to sender of the current message, if available.
|
D |
stateData() |
S |
stateName() |
scala.Option<PersistentFSM.Reason> |
stopReason() |
scala.Option<scala.concurrent.duration.FiniteDuration> |
timeout() |
PersistentFSM.State<S,D,E> |
using(D nextStateData)
Modify state transition descriptor with new state data.
|
PersistentFSM.State<S,D,E> |
withNotification(boolean notifies) |
PersistentFSM.State<S,D,E> |
withStopReason(PersistentFSM.Reason reason)
INTERNAL API.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public State(S stateName, D stateData, scala.Option<scala.concurrent.duration.FiniteDuration> timeout, scala.Option<PersistentFSM.Reason> stopReason, scala.collection.immutable.List<java.lang.Object> replies, scala.collection.Seq<E> domainEvents, scala.Function1<D,scala.runtime.BoxedUnit> afterTransitionDo, boolean notifies)
public PersistentFSM.State<S,D,E> applying(java.lang.Object... events)
events
- (undocumented)public S stateName()
public D stateData()
public scala.Option<scala.concurrent.duration.FiniteDuration> timeout()
public scala.Option<PersistentFSM.Reason> stopReason()
public scala.collection.immutable.List<java.lang.Object> replies()
public scala.collection.Seq<E> domainEvents()
public scala.Function1<D,scala.runtime.BoxedUnit> afterTransitionDo()
public boolean notifies()
public 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<java.lang.Object> replies, boolean notifies, scala.collection.Seq<E> domainEvents, scala.Function1<D,scala.runtime.BoxedUnit> afterTransitionDo)
stateName
- (undocumented)stateData
- (undocumented)timeout
- (undocumented)stopReason
- (undocumented)replies
- (undocumented)notifies
- (undocumented)domainEvents
- (undocumented)afterTransitionDo
- (undocumented)public PersistentFSM.State<S,D,E> forMax(scala.concurrent.duration.Duration timeout)
Use Duration.Inf to deactivate an existing timeout.
timeout
- (undocumented)public PersistentFSM.State<S,D,E> replying(java.lang.Object replyValue)
replyValue
- (undocumented)public PersistentFSM.State<S,D,E> using(D nextStateData)
nextStateData
- (undocumented)public PersistentFSM.State<S,D,E> withStopReason(PersistentFSM.Reason reason)
reason
- (undocumented)public PersistentFSM.State<S,D,E> withNotification(boolean notifies)
public PersistentFSM.State<S,D,E> applying(scala.collection.Seq<E> events)
events
- (undocumented)public PersistentFSM.State<S,D,E> andThen(scala.Function1<D,scala.runtime.BoxedUnit> handler)
handler
- (undocumented)