Trait

akka.persistence.fsm

LoggingPersistentFSM

Related Doc: package fsm

Permalink

trait LoggingPersistentFSM[S, D, E] extends PersistentFSMBase[S, D, E]

Stackable trait for akka.actor.FSM which adds a rolling event log and debug logging capabilities (analogous to akka.event.LoggingReceive).

Self Type
LoggingPersistentFSM[S, D, E] with Actor
Source
PersistentFSMBase.scala
Linear Supertypes
Known Subclasses
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LoggingPersistentFSM
  2. PersistentFSMBase
  3. ActorLogging
  4. Listeners
  5. Actor
  6. AnyRef
  7. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type Event = PersistentFSM.Event[D]

    Permalink
    Definition Classes
    PersistentFSMBase
  2. type Receive = PartialFunction[Any, Unit]

    Permalink
    Definition Classes
    Actor
  3. type State = PersistentFSM.State[S, D, E]

    Permalink
    Definition Classes
    PersistentFSMBase
  4. type StateFunction = PartialFunction[(LoggingPersistentFSM.this)#Event, (LoggingPersistentFSM.this)#State]

    Permalink
    Definition Classes
    PersistentFSMBase
  5. type StopEvent = PersistentFSM.StopEvent[S, D]

    Permalink
    Definition Classes
    PersistentFSMBase
  6. type Timeout = Option[FiniteDuration]

    Permalink
    Definition Classes
    PersistentFSMBase
  7. final class TransformHelper extends AnyRef

    Permalink
    Definition Classes
    PersistentFSMBase
  8. type TransitionHandler = PartialFunction[(S, S), Unit]

    Permalink
    Definition Classes
    PersistentFSMBase

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from LoggingPersistentFSM[S, D, E] to any2stringadd[LoggingPersistentFSM[S, D, E]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. val ->: PersistentFSM.->.type

    Permalink

    This extractor is just convenience for matching a (S, S) pair, including a reminder what the new state is.

    This extractor is just convenience for matching a (S, S) pair, including a reminder what the new state is.

    Definition Classes
    PersistentFSMBase
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. val Event: PersistentFSM.Event.type

    Permalink
    Definition Classes
    PersistentFSMBase
  7. val StateTimeout: PersistentFSM.StateTimeout.type

    Permalink

    This case object is received in case of a state timeout.

    This case object is received in case of a state timeout.

    Definition Classes
    PersistentFSMBase
  8. val StopEvent: PersistentFSM.StopEvent.type

    Permalink
    Definition Classes
    PersistentFSMBase
  9. def aroundPostRestart(reason: Throwable): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  10. def aroundPostStop(): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  11. def aroundPreRestart(reason: Throwable, message: Option[Any]): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  12. def aroundPreStart(): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  13. def aroundReceive(receive: actor.Actor.Receive, msg: Any): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  14. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  15. final def cancelTimer(name: String): Unit

    Permalink

    Cancel named timer, ensuring that the message is not subsequently delivered (no race).

    Cancel named timer, ensuring that the message is not subsequently delivered (no race).

    name

    of the timer to cancel

    Definition Classes
    PersistentFSMBase
  16. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. implicit val context: ActorContext

    Permalink
    Definition Classes
    Actor
  18. def ensuring(cond: (LoggingPersistentFSM[S, D, E]) ⇒ Boolean, msg: ⇒ Any): LoggingPersistentFSM[S, D, E]

    Permalink
    Implicit information
    This member is added by an implicit conversion from LoggingPersistentFSM[S, D, E] to Ensuring[LoggingPersistentFSM[S, D, E]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  19. def ensuring(cond: (LoggingPersistentFSM[S, D, E]) ⇒ Boolean): LoggingPersistentFSM[S, D, E]

    Permalink
    Implicit information
    This member is added by an implicit conversion from LoggingPersistentFSM[S, D, E] to Ensuring[LoggingPersistentFSM[S, D, E]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  20. def ensuring(cond: Boolean, msg: ⇒ Any): LoggingPersistentFSM[S, D, E]

    Permalink
    Implicit information
    This member is added by an implicit conversion from LoggingPersistentFSM[S, D, E] to Ensuring[LoggingPersistentFSM[S, D, E]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  21. def ensuring(cond: Boolean): LoggingPersistentFSM[S, D, E]

    Permalink
    Implicit information
    This member is added by an implicit conversion from LoggingPersistentFSM[S, D, E] to Ensuring[LoggingPersistentFSM[S, D, E]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  22. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  24. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  25. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from LoggingPersistentFSM[S, D, E] to StringFormat[LoggingPersistentFSM[S, D, E]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  26. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  27. def getLog: IndexedSeq[LogEntry[S, D]]

    Permalink

    Retrieve current rolling log in oldest-first order.

    Retrieve current rolling log in oldest-first order. The log is filled with each incoming event before processing by the user supplied state handler. The log entries are lost when this actor is restarted.

    Attributes
    protected
  28. def gossip(msg: Any)(implicit sender: ActorRef): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Listeners
  29. final def goto(nextStateName: S): (LoggingPersistentFSM.this)#State

    Permalink

    Produce transition to other state.

    Produce transition to other state. Return this from a state function in order to effect the transition.

    This method always triggers transition events, even for A -> A transitions. If you want to stay in the same state without triggering an state transition event use #stay instead.

    nextStateName

    state designator for the next state

    returns

    state transition descriptor

    Definition Classes
    PersistentFSMBase
  30. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  31. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  32. final def isTimerActive(name: String): Boolean

    Permalink

    Inquire whether the named timer is still active.

    Inquire whether the named timer is still active. Returns true unless the timer does not exist, has previously been canceled or if it was a single-shot timer whose message was already received.

    Definition Classes
    PersistentFSMBase
  33. def listenerManagement: actor.Actor.Receive

    Permalink
    Attributes
    protected
    Definition Classes
    Listeners
  34. val listeners: Set[ActorRef]

    Permalink
    Attributes
    protected
    Definition Classes
    Listeners
  35. def log: LoggingAdapter

    Permalink
    Definition Classes
    ActorLogging
  36. def logDepth: Int

    Permalink
  37. def logTermination(reason: Reason): Unit

    Permalink

    By default PersistentFSM.Failure is logged at error level and other reason types are not logged.

    By default PersistentFSM.Failure is logged at error level and other reason types are not logged. It is possible to override this behavior.

    Attributes
    protected
    Definition Classes
    PersistentFSMBase
  38. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  39. final def nextStateData: D

    Permalink

    Return next state data (available in onTransition handlers)

    Return next state data (available in onTransition handlers)

    Definition Classes
    PersistentFSMBase
  40. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  41. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  42. final def onTermination(terminationHandler: PartialFunction[(LoggingPersistentFSM.this)#StopEvent, Unit]): Unit

    Permalink

    Set handler which is called upon termination of this FSM actor.

    Set handler which is called upon termination of this FSM actor. Calling this method again will overwrite the previous contents.

    Definition Classes
    PersistentFSMBase
  43. final def onTransition(transitionHandler: (LoggingPersistentFSM.this)#TransitionHandler): Unit

    Permalink

    Set handler which is called upon each state transition, i.e.

    Set handler which is called upon each state transition, i.e. not when staying in the same state. This may use the pair extractor defined in the FSM companion object like so:

    onTransition {
      case Old -> New => doSomething
    }
    

    It is also possible to supply a 2-ary function object:

    onTransition(handler _)
    
    private def handler(from: S, to: S) { ... }
    

    The underscore is unfortunately necessary to enable the nicer syntax shown above (it uses the implicit conversion total2pf under the hood).

    Multiple handlers may be installed, and every one of them will be called, not only the first one matching.

    Definition Classes
    PersistentFSMBase
  44. def postRestart(reason: Throwable): Unit

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  45. def postStop(): Unit

    Permalink

    Call onTermination hook; if you want to retain this behavior when overriding make sure to call super.postStop().

    Call onTermination hook; if you want to retain this behavior when overriding make sure to call super.postStop().

    Please note that this method is called by default from preRestart(), so override that one if onTermination shall not be called during restart.

    Definition Classes
    PersistentFSMBase → Actor
  46. def preRestart(reason: Throwable, message: Option[Any]): Unit

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  47. def preStart(): Unit

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  48. def receive: (LoggingPersistentFSM.this)#Receive

    Permalink
    Definition Classes
    PersistentFSMBase → Actor
  49. implicit final val self: ActorRef

    Permalink
    Definition Classes
    Actor
  50. final def sender(): ActorRef

    Permalink
    Definition Classes
    Actor
  51. final def setStateTimeout(state: S, timeout: (LoggingPersistentFSM.this)#Timeout): Unit

    Permalink

    Set state timeout explicitly.

    Set state timeout explicitly. This method can safely be used from within a state handler.

    Definition Classes
    PersistentFSMBase
  52. final def setTimer(name: String, msg: Any, timeout: FiniteDuration, repeat: Boolean = false): Unit

    Permalink

    Schedule named timer to deliver message after given delay, possibly repeating.

    Schedule named timer to deliver message after given delay, possibly repeating. Any existing timer with the same name will automatically be canceled before adding the new timer.

    name

    identifier to be used with cancelTimer()

    msg

    message to be delivered

    timeout

    delay of first message delivery and between subsequent messages

    repeat

    send once if false, scheduleAtFixedRate if true

    Definition Classes
    PersistentFSMBase
  53. final def startWith(stateName: S, stateData: D, timeout: (LoggingPersistentFSM.this)#Timeout = None): Unit

    Permalink

    Set initial state.

    Set initial state. Call this method from the constructor before the #initialize method. If different state is needed after a restart this method, followed by #initialize, can be used in the actor life cycle hooks akka.actor.Actor#preStart and akka.actor.Actor#postRestart.

    stateName

    initial state designator

    stateData

    initial state data

    timeout

    state timeout for the initial state, overriding the default timeout for that state

    Definition Classes
    PersistentFSMBase
  54. final def stateData: D

    Permalink

    Return current state data (i.e.

    Return current state data (i.e. object of type D)

    Definition Classes
    PersistentFSMBase
  55. final def stateName: S

    Permalink

    Return current state name (i.e.

    Return current state name (i.e. object of type S)

    Definition Classes
    PersistentFSMBase
  56. final def stay(): (LoggingPersistentFSM.this)#State

    Permalink

    Produce "empty" transition descriptor.

    Produce "empty" transition descriptor. Return this from a state function when no state change is to be effected.

    No transition event will be triggered by #stay. If you want to trigger an event like S -> S for onTransition to handle use goto instead.

    returns

    descriptor for staying in current state

    Definition Classes
    PersistentFSMBase
  57. final def stop(reason: Reason, stateData: D): (LoggingPersistentFSM.this)#State

    Permalink

    Produce change descriptor to stop this FSM actor including specified reason.

    Produce change descriptor to stop this FSM actor including specified reason.

    Definition Classes
    PersistentFSMBase
  58. final def stop(reason: Reason): (LoggingPersistentFSM.this)#State

    Permalink

    Produce change descriptor to stop this FSM actor including specified reason.

    Produce change descriptor to stop this FSM actor including specified reason.

    Definition Classes
    PersistentFSMBase
  59. final def stop(): (LoggingPersistentFSM.this)#State

    Permalink

    Produce change descriptor to stop this FSM actor with reason "Normal".

    Produce change descriptor to stop this FSM actor with reason "Normal".

    Definition Classes
    PersistentFSMBase
  60. def supervisorStrategy: SupervisorStrategy

    Permalink
    Definition Classes
    Actor
  61. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  62. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  63. implicit final def total2pf(transitionHandler: (S, S) ⇒ Unit): (LoggingPersistentFSM.this)#TransitionHandler

    Permalink

    Convenience wrapper for using a total function instead of a partial function literal.

    Convenience wrapper for using a total function instead of a partial function literal. To be used with onTransition.

    Definition Classes
    PersistentFSMBase
  64. final def transform(func: (LoggingPersistentFSM.this)#StateFunction): (LoggingPersistentFSM.this)#TransformHelper

    Permalink
    Definition Classes
    PersistentFSMBase
  65. def unhandled(message: Any): Unit

    Permalink
    Definition Classes
    Actor
  66. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  67. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  68. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  69. final def when(stateName: S, stateTimeout: FiniteDuration = null)(stateFunction: (LoggingPersistentFSM.this)#StateFunction): Unit

    Permalink

    Insert a new StateFunction at the end of the processing chain for the given state.

    Insert a new StateFunction at the end of the processing chain for the given state. If the stateTimeout parameter is set, entering this state without a differing explicit timeout setting will trigger a StateTimeout event; the same is true when using #stay.

    stateName

    designator for the state

    stateTimeout

    default state timeout for this state

    stateFunction

    partial function describing response to input

    Definition Classes
    PersistentFSMBase
  70. final def whenUnhandled(stateFunction: (LoggingPersistentFSM.this)#StateFunction): Unit

    Permalink

    Set handler which is called upon reception of unhandled messages.

    Set handler which is called upon reception of unhandled messages. Calling this method again will overwrite the previous contents.

    The current state may be queried using stateName.

    Definition Classes
    PersistentFSMBase
  71. def [B](y: B): (LoggingPersistentFSM[S, D, E], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from LoggingPersistentFSM[S, D, E] to ArrowAssoc[LoggingPersistentFSM[S, D, E]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. def ->[B](y: B): (LoggingPersistentFSM[S, D, E], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from LoggingPersistentFSM[S, D, E] to ArrowAssoc[LoggingPersistentFSM[S, D, E]] performed by method ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (loggingPersistentFSM: ArrowAssoc[LoggingPersistentFSM[S, D, E]]).->(y)
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()

Inherited from PersistentFSMBase[S, D, E]

Inherited from ActorLogging

Inherited from Listeners

Inherited from Actor

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from LoggingPersistentFSM[S, D, E] to any2stringadd[LoggingPersistentFSM[S, D, E]]

Inherited by implicit conversion StringFormat from LoggingPersistentFSM[S, D, E] to StringFormat[LoggingPersistentFSM[S, D, E]]

Inherited by implicit conversion Ensuring from LoggingPersistentFSM[S, D, E] to Ensuring[LoggingPersistentFSM[S, D, E]]

Inherited by implicit conversion ArrowAssoc from LoggingPersistentFSM[S, D, E] to ArrowAssoc[LoggingPersistentFSM[S, D, E]]

Ungrouped