diff --git a/akka-actor/src/main/scala/akka/actor/ActorCell.scala b/akka-actor/src/main/scala/akka/actor/ActorCell.scala index 3b2c743a6b..0955595640 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorCell.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorCell.scala @@ -557,8 +557,8 @@ private[akka] class ActorCell( } } catch { case NonFatal(e) ⇒ throw new ActorInitializationException(self, "exception during creation", e match { - case i: InstantiationException => i.getCause - case other => other + case i: InstantiationException ⇒ i.getCause + case other ⇒ other }) } } diff --git a/akka-docs/java/code/docs/jrouting/RouterViaProgramExample.java b/akka-docs/java/code/docs/jrouting/RouterViaProgramExample.java index ce46307eb7..72843b44c6 100644 --- a/akka-docs/java/code/docs/jrouting/RouterViaProgramExample.java +++ b/akka-docs/java/code/docs/jrouting/RouterViaProgramExample.java @@ -55,7 +55,7 @@ public class RouterViaProgramExample { ActorRef actor2 = system.actorOf(new Props(ExampleActor.class)); ActorRef actor3 = system.actorOf(new Props(ExampleActor.class)); Iterable routees = Arrays.asList(new ActorRef[] { actor1, actor2, actor3 }); - ActorRef router2 = system.actorOf(new Props(ExampleActor.class).withRouter(RoundRobinRouter.create(routees))); + ActorRef router2 = system.actorOf(new Props().withRouter(RoundRobinRouter.create(routees))); //#programmaticRoutingRoutees for (int i = 1; i <= 6; i++) { router2.tell(new ExampleActor.Message(i)); diff --git a/akka-docs/java/routing.rst b/akka-docs/java/routing.rst index 4d01642a72..9bd770f9f6 100644 --- a/akka-docs/java/routing.rst +++ b/akka-docs/java/routing.rst @@ -33,6 +33,11 @@ You can also give the router already created routees as in: .. includecode:: code/akka/docs/jrouting/RouterViaProgramExample.java#programmaticRoutingRoutees +It should be noted that no actor factory or class needs to be provided in this +case, as the ``Router`` will not create any children on its own (which is not +true anymore when using a resizer). The routees can also be specified by giving +their path strings. + When you create a router programmatically you define the number of routees *or* you pass already created routees to it. If you send both parameters to the router *only* the latter will be used, i.e. ``nrOfInstances`` is disregarded. @@ -48,7 +53,7 @@ Once you have the router actor it is just to send messages to it as you would to router.tell(new MyMsg()); -The router will apply its behavior to the message it receives and forward it to the routees. +The router will forward the message to its routees according to its routing policy. Remotely Deploying Routees ************************** diff --git a/akka-docs/scala/code/docs/routing/RouterViaProgramExample.scala b/akka-docs/scala/code/docs/routing/RouterViaProgramExample.scala index 195fc20445..79219b742b 100644 --- a/akka-docs/scala/code/docs/routing/RouterViaProgramExample.scala +++ b/akka-docs/scala/code/docs/routing/RouterViaProgramExample.scala @@ -29,7 +29,7 @@ object RoutingProgrammaticallyExample extends App { val actor2 = system.actorOf(Props[ExampleActor1]) val actor3 = system.actorOf(Props[ExampleActor1]) val routees = Vector[ActorRef](actor1, actor2, actor3) - val router2 = system.actorOf(Props[ExampleActor1].withRouter( + val router2 = system.actorOf(Props().withRouter( RoundRobinRouter(routees = routees))) //#programmaticRoutingRoutees 1 to 6 foreach { i ⇒ router2 ! Message1(i) } diff --git a/akka-docs/scala/routing.rst b/akka-docs/scala/routing.rst index 737c9e31e7..a66e7f890d 100644 --- a/akka-docs/scala/routing.rst +++ b/akka-docs/scala/routing.rst @@ -33,6 +33,11 @@ You can also give the router already created routees as in: .. includecode:: code/akka/docs/routing/RouterViaProgramExample.scala#programmaticRoutingRoutees +It should be noted that no actor factory or class needs to be provided in this +case, as the ``Router`` will not create any children on its own (which is not +true anymore when using a resizer). The routees can also be specified by giving +their path strings. + When you create a router programmatically you define the number of routees *or* you pass already created routees to it. If you send both parameters to the router *only* the latter will be used, i.e. ``nrOfInstances`` is disregarded. @@ -48,7 +53,7 @@ Once you have the router actor it is just to send messages to it as you would to router ! MyMsg -The router will apply its behavior to the message it receives and forward it to the routees. +The router will forward the message to its routees according to its routing policy. Remotely Deploying Routees **************************