add ActorRef.noSender() for the Java API, see #3429

- Actor.noSender is not accessible from Java, but it was in 2.1 so don’t
  remove
- replaced all “null” in doc tests with ActorRef.noSender()
This commit is contained in:
Roland Kuhn 2013-06-05 16:59:25 +02:00
parent 6c96485b26
commit a2a646af4e
24 changed files with 92 additions and 79 deletions

View file

@ -77,11 +77,11 @@ public class CustomRouterDocTest {
public void countVotesAsIntendedNotAsInFlorida() throws Exception {
ActorRef routedActor = system.actorOf(
Props.empty().withRouter(new VoteCountRouter()));
routedActor.tell(DemocratVote, null);
routedActor.tell(DemocratVote, null);
routedActor.tell(RepublicanVote, null);
routedActor.tell(DemocratVote, null);
routedActor.tell(RepublicanVote, null);
routedActor.tell(DemocratVote, ActorRef.noSender());
routedActor.tell(DemocratVote, ActorRef.noSender());
routedActor.tell(RepublicanVote, ActorRef.noSender());
routedActor.tell(DemocratVote, ActorRef.noSender());
routedActor.tell(RepublicanVote, ActorRef.noSender());
Timeout timeout = new Timeout(Duration.create(1, "seconds"));
Future<Object> democratsResult =
ask(routedActor, DemocratCountResult, timeout);

View file

@ -47,7 +47,7 @@ public class RouterViaConfigExample {
Props.create(ExampleActor.class).withRouter(new FromConfig()), "myrouter1");
//#configurableRouting
for (int i = 1; i <= 10; i++) {
router.tell(new ExampleActor.Message(i), null);
router.tell(new ExampleActor.Message(i), ActorRef.noSender());
}
//#configurableRoutingWithResizer
@ -55,7 +55,7 @@ public class RouterViaConfigExample {
Props.create(ExampleActor.class).withRouter(new FromConfig()), "myrouter2");
//#configurableRoutingWithResizer
for (int i = 1; i <= 10; i++) {
router2.tell(new ExampleActor.Message(i), null);
router2.tell(new ExampleActor.Message(i), ActorRef.noSender());
}
}
}

View file

@ -55,7 +55,7 @@ public class RouterViaProgramDocTest {
Props.empty().withRouter(new RoundRobinRouter(routees)));
//#programmaticRoutingRouteePaths
for (int i = 1; i <= 6; i++) {
router.tell(new ExampleActor.Message(i), null);
router.tell(new ExampleActor.Message(i), ActorRef.noSender());
}
}};
}

View file

@ -50,7 +50,7 @@ public class RouterViaProgramExample {
Props.create(ExampleActor.class).withRouter(new RoundRobinRouter(nrOfInstances)));
//#programmaticRoutingNrOfInstances
for (int i = 1; i <= 6; i++) {
router1.tell(new ExampleActor.Message(i), null);
router1.tell(new ExampleActor.Message(i), ActorRef.noSender());
}
//#programmaticRoutingRoutees
@ -63,7 +63,7 @@ public class RouterViaProgramExample {
Props.empty().withRouter(RoundRobinRouter.create(routees)));
//#programmaticRoutingRoutees
for (int i = 1; i <= 6; i++) {
router2.tell(new ExampleActor.Message(i), null);
router2.tell(new ExampleActor.Message(i), ActorRef.noSender());
}
//#programmaticRoutingWithResizer
@ -74,7 +74,7 @@ public class RouterViaProgramExample {
Props.create(ExampleActor.class).withRouter(new RoundRobinRouter(resizer)));
//#programmaticRoutingWithResizer
for (int i = 1; i <= 6; i++) {
router3.tell(new ExampleActor.Message(i), null);
router3.tell(new ExampleActor.Message(i), ActorRef.noSender());
}
//#remoteRoutees