diff --git a/akka-actor-tests/src/test/scala/akka/actor/actor/Bench.scala b/akka-actor-tests/src/test/scala/akka/actor/actor/Bench.scala index f018de635c..1f121babd5 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/actor/Bench.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/actor/Bench.scala @@ -78,7 +78,7 @@ object Chameneos { var sumMeetings = 0 var numFaded = 0 - override def preStart = { + override def preStart() = { for (i <- 0 until numChameneos) actorOf(new Chameneo(self, colours(i % 3), i)) } diff --git a/akka-actor-tests/src/test/scala/akka/actor/supervisor/RestartStrategySpec.scala b/akka-actor-tests/src/test/scala/akka/actor/supervisor/RestartStrategySpec.scala index f2a3103d08..c2af94ba1a 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/supervisor/RestartStrategySpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/supervisor/RestartStrategySpec.scala @@ -46,7 +46,7 @@ class RestartStrategySpec extends JUnitSuite { secondRestartLatch.open } - override def postStop = { + override def postStop() = { stopLatch.open } }) @@ -131,7 +131,7 @@ class RestartStrategySpec extends JUnitSuite { thirdRestartLatch.open } - override def postStop = { + override def postStop() = { if (restartLatch.isOpen) { secondRestartLatch.open } @@ -189,7 +189,7 @@ class RestartStrategySpec extends JUnitSuite { secondRestartLatch.open } - override def postStop = { + override def postStop() = { stopLatch.open } }) @@ -243,7 +243,7 @@ class RestartStrategySpec extends JUnitSuite { restartLatch.open } - override def postStop = { + override def postStop() = { stopLatch.open } }) diff --git a/akka-actor-tests/src/test/scala/akka/actor/supervisor/Ticket669Spec.scala b/akka-actor-tests/src/test/scala/akka/actor/supervisor/Ticket669Spec.scala index 206d06d1c4..33f7a72434 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/supervisor/Ticket669Spec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/supervisor/Ticket669Spec.scala @@ -65,7 +65,7 @@ object Ticket669Spec { self.reply_?("failure1") } - override def postStop { + override def postStop() { self.reply_?("failure2") } } diff --git a/akka-actor/src/main/scala/akka/actor/UntypedActor.scala b/akka-actor/src/main/scala/akka/actor/UntypedActor.scala index 41bf7ac048..71904288ef 100644 --- a/akka-actor/src/main/scala/akka/actor/UntypedActor.scala +++ b/akka-actor/src/main/scala/akka/actor/UntypedActor.scala @@ -88,14 +88,14 @@ abstract class UntypedActor extends Actor { *

* Is called when an Actor is started by invoking 'actor.start()'. */ - override def preStart {} + override def preStart() {} /** * User overridable callback. *

* Is called when 'actor.stop()' is invoked. */ - override def postStop {} + override def postStop() {} /** * User overridable callback. diff --git a/akka-actor/src/main/scala/akka/routing/Pool.scala b/akka-actor/src/main/scala/akka/routing/Pool.scala index 6ab6aa0c4d..5a906df851 100644 --- a/akka-actor/src/main/scala/akka/routing/Pool.scala +++ b/akka-actor/src/main/scala/akka/routing/Pool.scala @@ -54,7 +54,7 @@ trait DefaultActorPool extends ActorPool { this: Actor => private var _lastCapacityChange = 0 private var _lastSelectorCount = 0 - override def postStop = _delegates foreach { + override def postStop() = _delegates foreach { delegate => try { delegate ! PoisonPill } catch { case e: Exception => } //Ignore any exceptions here diff --git a/akka-docs/intro/examples/Pi.scala b/akka-docs/intro/examples/Pi.scala index 1635229802..41f8e88b9f 100644 --- a/akka-docs/intro/examples/Pi.scala +++ b/akka-docs/intro/examples/Pi.scala @@ -91,11 +91,11 @@ object Pi extends App { } //#master-receive - override def preStart { + override def preStart() { start = now } - override def postStop { + override def postStop() { // tell the world that the calculation is complete println( "\n\tPi estimate: \t\t%s\n\tCalculation time: \t%s millis" diff --git a/akka-docs/intro/getting-started-first-scala-eclipse.rst b/akka-docs/intro/getting-started-first-scala-eclipse.rst index ebd0064620..5c3987866a 100644 --- a/akka-docs/intro/getting-started-first-scala-eclipse.rst +++ b/akka-docs/intro/getting-started-first-scala-eclipse.rst @@ -307,11 +307,11 @@ Here is the master actor:: def receive = { ... } - override def preStart { + override def preStart() { start = System.currentTimeMillis } - override def postStop { + override def postStop() { // tell the world that the calculation is complete println( "\n\tPi estimate: \t\t%s\n\tCalculation time: \t%s millis" diff --git a/akka-docs/intro/getting-started-first-scala.rst b/akka-docs/intro/getting-started-first-scala.rst index c6ea2f4fe1..364c0d276b 100644 --- a/akka-docs/intro/getting-started-first-scala.rst +++ b/akka-docs/intro/getting-started-first-scala.rst @@ -291,11 +291,11 @@ Here is the master actor:: def receive = { ... } - override def preStart { + override def preStart() { start = System.currentTimeMillis } - override def postStop { + override def postStop() { // tell the world that the calculation is complete println( "\n\tPi estimate: \t\t%s\n\tCalculation time: \t%s millis" @@ -451,11 +451,11 @@ But before we package it up and run it, let's take a look at the full code now, if (nrOfResults == nrOfMessages) self.stop() } - override def preStart { + override def preStart() { start = System.currentTimeMillis } - override def postStop { + override def postStop() { // tell the world that the calculation is complete println( "\n\tPi estimate: \t\t%s\n\tCalculation time: \t%s millis" diff --git a/akka-docs/pending/fault-tolerance-scala.rst b/akka-docs/pending/fault-tolerance-scala.rst index 6070f9e01e..84cc48d549 100644 --- a/akka-docs/pending/fault-tolerance-scala.rst +++ b/akka-docs/pending/fault-tolerance-scala.rst @@ -316,7 +316,7 @@ Supervised actors have the option to reply to the initial sender within preResta self.reply_?(reason.getMessage) } - override def postStop { + override def postStop() { self.reply_?("stopped by supervisor") } } diff --git a/akka-docs/pending/http.rst b/akka-docs/pending/http.rst index 801b786da0..9de34d05e7 100644 --- a/akka-docs/pending/http.rst +++ b/akka-docs/pending/http.rst @@ -269,7 +269,7 @@ Finally, bind the *handleHttpRequest* function of the *Endpoint* trait to the ac // // this is where you want attach your endpoint hooks // - override def preStart = { + override def preStart() = { // // we expect there to be one root and that it's already been started up // obviously there are plenty of other ways to obtaining this actor @@ -397,7 +397,7 @@ As noted above, hook functions are non-exclusive. This means multiple actors can // // this is where you want attach your endpoint hooks // - override def preStart = { + override def preStart() = { // // we expect there to be one root and that it's already been started up // obviously there are plenty of other ways to obtaining this actor diff --git a/akka-docs/pending/tutorial-chat-server-scala.rst b/akka-docs/pending/tutorial-chat-server-scala.rst index 830bf75c22..afec3e948f 100644 --- a/akka-docs/pending/tutorial-chat-server-scala.rst +++ b/akka-docs/pending/tutorial-chat-server-scala.rst @@ -221,7 +221,7 @@ I'll try to show you how we can make use Scala's mixins to decouple the Actor im protected def sessionManagement: Receive protected def shutdownSessions(): Unit - override def postStop = { + override def postStop() = { EventHandler.info(this, "Chat server is shutting down...") shutdownSessions self.unlink(storage) @@ -422,7 +422,7 @@ We have now created the full functionality for the chat server, all nicely decou SessionManagement with ChatManagement with MemoryChatStorageFactory { - override def preStart = { + override def preStart() = { remote.start("localhost", 2552); remote.register("chat:service", self) //Register the actor with the specified service id } diff --git a/akka-docs/scala/actors.rst b/akka-docs/scala/actors.rst index 62db0ad619..a3e0bbd28f 100644 --- a/akka-docs/scala/actors.rst +++ b/akka-docs/scala/actors.rst @@ -385,7 +385,7 @@ When you start the ``Actor`` then it will automatically call the ``def preStart` .. code-block:: scala - override def preStart = { + override def preStart() = { ... // initialization code } @@ -402,7 +402,7 @@ When stop is called then a call to the ``def postStop`` callback method will tak .. code-block:: scala - override def postStop = { + override def postStop() = { ... // clean up resources } diff --git a/akka-http/src/main/scala/akka/http/Mist.scala b/akka-http/src/main/scala/akka/http/Mist.scala index 379cbfb36d..99e717281a 100644 --- a/akka-http/src/main/scala/akka/http/Mist.scala +++ b/akka-http/src/main/scala/akka/http/Mist.scala @@ -269,7 +269,7 @@ class RootEndpoint extends Actor with Endpoint { // adopt the configured id if (RootActorBuiltin) self.id = RootActorID - override def preStart = + override def preStart() = _attachments = Tuple2((uri: String) => {uri eq Root}, (uri: String) => this.actor) :: _attachments def recv: Receive = { diff --git a/akka-remote/src/test/scala/remote/ServerInitiatedRemoteSessionActorSpec.scala b/akka-remote/src/test/scala/remote/ServerInitiatedRemoteSessionActorSpec.scala index c2277200b1..09a5f96bde 100644 --- a/akka-remote/src/test/scala/remote/ServerInitiatedRemoteSessionActorSpec.scala +++ b/akka-remote/src/test/scala/remote/ServerInitiatedRemoteSessionActorSpec.scala @@ -19,8 +19,8 @@ object ServerInitiatedRemoteSessionActorSpec { class RemoteStatefullSessionActorSpec extends Actor { - override def preStart = instantiatedSessionActors.add(self) - override def postStop = instantiatedSessionActors.remove(self) + override def preStart() = instantiatedSessionActors.add(self) + override def postStop() = instantiatedSessionActors.remove(self) var user: String = "anonymous" def receive = { diff --git a/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala b/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala index a19ed26da0..90f6f2701e 100644 --- a/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala +++ b/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala @@ -186,7 +186,7 @@ protected def sessionManagement: Receive protected def shutdownSessions(): Unit - override def postStop = { + override def postStop() = { EventHandler.info(this, "Chat server is shutting down...") shutdownSessions self.unlink(storage) @@ -206,7 +206,7 @@ SessionManagement with ChatManagement with MemoryChatStorageFactory { - override def preStart = { + override def preStart() = { remote.start("localhost", 2552); remote.register("chat:service", self) //Register the actor with the specified service id } diff --git a/akka-tutorials/akka-tutorial-first/src/main/scala/Pi.scala b/akka-tutorials/akka-tutorial-first/src/main/scala/Pi.scala index e6d8b87c14..41f562791a 100644 --- a/akka-tutorials/akka-tutorial-first/src/main/scala/Pi.scala +++ b/akka-tutorials/akka-tutorial-first/src/main/scala/Pi.scala @@ -104,11 +104,11 @@ object Pi extends App { if (nrOfResults == nrOfMessages) self.stop() } - override def preStart { + override def preStart() { start = System.currentTimeMillis } - override def postStop { + override def postStop() { // tell the world that the calculation is complete println( "\n\tPi estimate: \t\t%s\n\tCalculation time: \t%s millis" diff --git a/akka-tutorials/akka-tutorial-second/src/main/scala/Pi.scala b/akka-tutorials/akka-tutorial-second/src/main/scala/Pi.scala index e7e10f56ef..35d29f8f6c 100644 --- a/akka-tutorials/akka-tutorial-second/src/main/scala/Pi.scala +++ b/akka-tutorials/akka-tutorial-second/src/main/scala/Pi.scala @@ -111,7 +111,7 @@ object Pi extends App { def receive = scatter // when we are stopped, stop our team of workers and our router - override def postStop { + override def postStop() { // send a PoisonPill to all workers telling them to shut down themselves router ! Broadcast(PoisonPill) // send a PoisonPill to the router, telling him to shut himself down diff --git a/akka-typed-actor/src/main/scala/akka/actor/TypedActor.scala b/akka-typed-actor/src/main/scala/akka/actor/TypedActor.scala index 7103c3fd5b..591613a203 100644 --- a/akka-typed-actor/src/main/scala/akka/actor/TypedActor.scala +++ b/akka-typed-actor/src/main/scala/akka/actor/TypedActor.scala @@ -83,11 +83,11 @@ import scala.reflect.BeanProperty * * def square(x: Int): Future[Integer] = future(x * x) * - * override def preStart = { + * override def preStart() = { * ... // optional initialization on start * } * - * override def postStop = { + * override def postStop() = { * ... // optional cleanup on stop * } * @@ -160,14 +160,14 @@ abstract class TypedActor extends Actor with Proxyable { *

* Is called when an Actor is started by invoking 'actor.start()'. */ - override def preStart {} + override def preStart() {} /** * User overridable callback. *

* Is called when 'actor.stop()' is invoked. */ - override def postStop {} + override def postStop() {} /** * User overridable callback.