RolePlayingAutomaton

trait RolePlayingAutomaton extends Actor with LoggingFSM[RPAState, RPAData]

Use this trait to implement your own scroll.internal.compartment.impl.Compartment specific role playing automaton. Please read the documentation for akka.actor.FSM carefully, since the features from that are applicable for role playing automatons.

Remember to call run() when you want to start this automaton in your scroll.internal.compartment.impl.Compartment instance.

This automaton will always start in state scroll.internal.rpa.RolePlayingAutomaton.Start, so hook in there.

Final state is always scroll.internal.rpa.RolePlayingAutomaton.Stop, that will terminate the actor system for this akka.actor.FSM.

Use the factory method RolePlayingAutomaton.Use to gain an instance of your specific FSM, e.g.:

trait MyCompartment extends Compartment {
// ... some roles and interaction

// your specific RPA here
class MyRolePlayingAutomaton extends RolePlayingAutomaton {
// specific behavior here
when(Start) {
// ...
}

onTransition {
// ...
}

run()
}

Use[MyRolePlayingAutomaton] For this
}

// start everything
new MyCompartment {}

Some predefined event types for messaging are available in the companion object. You may want to define your own states and event types. Simply use a companion object for this as well.

Companion
object
trait LoggingFSM[RPAState, RPAData]
trait FSM[RPAState, RPAData]
trait ActorLogging
trait Listeners
trait Actor
class Object
trait Matchable
class Any

Type members

Inherited classlikes

final
Inherited from
FSM

Inherited types

type Event >: Event[D] <: Event[D]
Inherited from
FSM
type Receive >: Receive <: Receive
Inherited from
Actor
type State >: State[S, D] <: State[S, D]
Inherited from
FSM
type StateFunction >: PartialFunction[Event, State] <: PartialFunction[Event, State]
Inherited from
FSM
type StopEvent >: StopEvent[S, D] <: StopEvent[S, D]
Inherited from
FSM
type Timeout >: Option[FiniteDuration] <: Option[FiniteDuration]
Inherited from
FSM
type TransitionHandler >: PartialFunction[(S, S), Unit] <: PartialFunction[(S, S), Unit]
Inherited from
FSM

Value members

Concrete methods

def halt(): State

Stops this automaton. Will set state to scroll.internal.rpa.RolePlayingAutomaton.Stop and terminates the actor system for this akka.actor.FSM.

Stops this automaton. Will set state to scroll.internal.rpa.RolePlayingAutomaton.Stop and terminates the actor system for this akka.actor.FSM.

def run(): Unit

Starts this automaton. Needs to be called first! Will set the initial state to scroll.internal.rpa.RolePlayingAutomaton.Start.

Starts this automaton. Needs to be called first! Will set the initial state to scroll.internal.rpa.RolePlayingAutomaton.Start.

Inherited methods

Inherited from
FSM
def akka$actor$LoggingFSM$$super$processEvent(event: Event, @unused source: AnyRef): Unit
Inherited from
LoggingFSM
final
def cancelTimer(name: String): Unit
Inherited from
FSM
protected
def getLog: IndexedSeq[LogEntry[RPAState, RPAData]]
Inherited from
LoggingFSM
protected
def gossip(msg: Any)(implicit sender: ActorRef): Unit
Inherited from
Listeners
final
def goto(nextStateName: RPAState): State
Inherited from
FSM
final
def initialize(): Unit
Inherited from
FSM
final
def isTimerActive(name: String): Boolean
Inherited from
FSM
protected
def listenerManagement: Receive
Inherited from
Listeners
def log: LoggingAdapter
Inherited from
ActorLogging
def logDepth: Int
Inherited from
LoggingFSM
Inherited from
FSM
final
def onTermination(terminationHandler: PartialFunction[StopEvent, Unit]): Unit
Inherited from
FSM
final
def onTransition(transitionHandler: TransitionHandler): Unit
Inherited from
FSM
@throws(classOf[Exception])
def postRestart(@unused reason: Throwable): Unit
Inherited from
Actor
override
def postStop(): Unit
Definition Classes
FSM -> Actor
Inherited from
FSM
@throws(classOf[Exception])
def preRestart(@unused reason: Throwable, @unused message: Option[Any]): Unit
Inherited from
Actor
@throws(classOf[Exception])
def preStart(): Unit
Inherited from
Actor
override
def receive: Receive
Definition Classes
FSM -> Actor
Inherited from
FSM
final
def sender(): ActorRef
Inherited from
Actor
final
def setStateTimeout(state: RPAState, timeout: Timeout): Unit
Inherited from
FSM
def startSingleTimer(name: String, msg: Any, delay: FiniteDuration): Unit
Inherited from
FSM
def startTimerAtFixedRate(name: String, msg: Any, interval: FiniteDuration): Unit
Inherited from
FSM
def startTimerWithFixedDelay(name: String, msg: Any, delay: FiniteDuration): Unit
Inherited from
FSM
final
def startWith(stateName: RPAState, stateData: RPAData, timeout: Timeout): Unit
Inherited from
FSM
final
Inherited from
FSM
final
Inherited from
FSM
final
def stay(): State
Inherited from
FSM
final
def stop(reason: Reason, stateData: RPAData): State
Inherited from
FSM
final
def stop(reason: Reason): State
Inherited from
FSM
final
def stop(): State
Inherited from
FSM
def supervisorStrategy: SupervisorStrategy
Inherited from
Actor
final
def transform(func: StateFunction): TransformHelper
Inherited from
FSM
def unhandled(message: Any): Unit
Inherited from
Actor
final
def when(stateName: RPAState, stateTimeout: FiniteDuration)(stateFunction: StateFunction): Unit
Inherited from
FSM
final
def whenUnhandled(stateFunction: StateFunction): Unit
Inherited from
FSM

Deprecated and Inherited methods

@deprecated(message = "Use startSingleTimer, startTimerWithFixedDelay or startTimerAtFixedRate instead. This has the same semantics as startTimerAtFixedRate, but startTimerWithFixedDelay is often preferred.", since = "2.6.0")
final
def setTimer(name: String, msg: Any, timeout: FiniteDuration, repeat: Boolean): Unit
Deprecated
[Since version 2.6.0] Use startSingleTimer, startTimerWithFixedDelay or startTimerAtFixedRate instead. This has the same semantics as startTimerAtFixedRate, but startTimerWithFixedDelay is often preferred.
Inherited from
FSM

Implicits

Inherited implicits

final implicit
def total2pf(transitionHandler: (RPAState, RPAState) => Unit): TransitionHandler
Inherited from
FSM