From a6b8a840fdaf8888a33a75de9ba9bc2a8d57adfb Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Thu, 4 Jul 2013 12:03:18 +0200 Subject: [PATCH] DOC: FSM start state in preStart/postRestart, see #3440 --- akka-actor/src/main/scala/akka/actor/FSM.scala | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/akka-actor/src/main/scala/akka/actor/FSM.scala b/akka-actor/src/main/scala/akka/actor/FSM.scala index f521c77d53..c6488de3e2 100644 --- a/akka-actor/src/main/scala/akka/actor/FSM.scala +++ b/akka-actor/src/main/scala/akka/actor/FSM.scala @@ -184,7 +184,7 @@ object FSM { * case Ev(SomeMsg) => ... // convenience when data not needed * } * when(Two, stateTimeout = 5 seconds) { ... } - * initialize + * initialize() * } * * @@ -286,7 +286,9 @@ trait FSM[S, D] extends Actor with Listeners with ActorLogging { register(stateName, stateFunction, Option(stateTimeout)) /** - * Set initial state. Call this method from the constructor before the #initialize method. + * 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]]. * * @param stateName initial state designator * @param stateData initial state data @@ -447,7 +449,10 @@ trait FSM[S, D] extends Actor with Listeners with ActorLogging { /** * Verify existence of initial state and setup timers. This should be the - * last call within the constructor. + * last call within the constructor, or [[akka.actor.Actor#preStart]] and + * [[akka.actor.Actor#postRestart]] + * + * @see [[#startWith]] */ final def initialize(): Unit = makeTransition(currentState)