Merge pull request #1289 from akka/wip-3166-FSM-initialize-parens-√

#3166 - Adding parenthesis to FSM.initialize
This commit is contained in:
Viktor Klang (√) 2013-04-03 06:44:13 -07:00
commit ae96654062
10 changed files with 12 additions and 14 deletions

View file

@ -91,7 +91,7 @@ object FSMActorSpec {
} }
// initialize the lock // initialize the lock
initialize initialize()
private def doLock() { private def doLock() {
lockedLatch.open lockedLatch.open

View file

@ -25,7 +25,7 @@ object FSMTransitionSpec {
whenUnhandled { whenUnhandled {
case Event("reply", _) stay replying "reply" case Event("reply", _) stay replying "reply"
} }
initialize initialize()
override def preRestart(reason: Throwable, msg: Option[Any]) { target ! "restarted" } override def preRestart(reason: Throwable, msg: Option[Any]) { target ! "restarted" }
} }

View file

@ -698,8 +698,7 @@ object SupervisorHierarchySpec {
stop stop
} }
initialize initialize()
} }
} }

View file

@ -451,7 +451,7 @@ trait FSM[S, D] extends Listeners with ActorLogging {
* Verify existence of initial state and setup timers. This should be the * Verify existence of initial state and setup timers. This should be the
* last call within the constructor. * last call within the constructor.
*/ */
final def initialize: Unit = makeTransition(currentState) final def initialize(): Unit = makeTransition(currentState)
/** /**
* Return current state name (i.e. object of type S) * Return current state name (i.e. object of type S)

View file

@ -276,7 +276,7 @@ class TimerBasedThrottler(var rate: Rate) extends Actor with Throttler with FSM[
case Active -> Idle stopTimer() case Active -> Idle stopTimer()
} }
initialize initialize()
private def startTimer(rate: Rate) = setTimer("morePermits", Tick, rate.duration, true) private def startTimer(rate: Rate) = setTimer("morePermits", Tick, rate.duration, true)
private def stopTimer() = cancelTimer("morePermits") private def stopTimer() = cancelTimer("morePermits")

View file

@ -81,7 +81,7 @@ class FSMDocSpec extends MyFavoriteTestFrameWorkPlusAkkaTestKit {
//#unhandled-elided //#unhandled-elided
//#fsm-body //#fsm-body
initialize initialize()
} }
//#simple-fsm //#simple-fsm
object DemoCode { object DemoCode {

View file

@ -336,7 +336,7 @@ private[akka] class ServerFSM(val controller: ActorRef, val channel: Channel) ex
stay stay
} }
initialize initialize()
} }
/** /**
@ -574,7 +574,7 @@ private[akka] class BarrierCoordinator extends Actor with LoggingFSM[BarrierCoor
throw BarrierTimeout(d) throw BarrierTimeout(d)
} }
initialize initialize()
def handleBarrier(data: Data): State = { def handleBarrier(data: Data): State = {
log.debug("handleBarrier({})", data) log.debug("handleBarrier({})", data)

View file

@ -257,8 +257,7 @@ private[akka] class ClientFSM(name: RoleName, controllerAddr: InetSocketAddress)
channel.close() channel.close()
} }
initialize initialize()
} }
/** /**

View file

@ -76,7 +76,7 @@ abstract class GenericBuncher[A: ClassTag, B](val singleTimeout: FiniteDuration,
stop stop
} }
initialize initialize()
} }
object Buncher { object Buncher {

View file

@ -55,7 +55,7 @@ class Chopstick extends Actor with FSM[ChopstickState, TakenBy] {
} }
// Initialze the chopstick // Initialze the chopstick
initialize initialize()
} }
/** /**
@ -155,7 +155,7 @@ class FSMHakker(name: String, left: ActorRef, right: ActorRef) extends Actor wit
} }
// Initialize the hakker // Initialize the hakker
initialize initialize()
private def startThinking(duration: FiniteDuration): State = { private def startThinking(duration: FiniteDuration): State = {
goto(Thinking) using TakenChopsticks(None, None) forMax duration goto(Thinking) using TakenChopsticks(None, None) forMax duration