Merge pull request #334 from jboner/wip-system-and-routers-∂π

Wip system and routers ∂π
This commit is contained in:
Roland Kuhn 2012-02-20 01:59:32 -08:00
commit ea45c8bdbb
14 changed files with 410 additions and 22 deletions

View file

@ -52,6 +52,16 @@ public class CustomRouterDocTestBase {
.withDispatcher("workers")); // MyActor workers run on "workers" dispatcher
//#dispatchers
}
@Test
public void demonstrateSupervisor() {
//#supervision
final SupervisorStrategy strategy = new OneForOneStrategy(5, Duration.parse("1 minute"),
new Class<?>[] { Exception.class });
final ActorRef router = system.actorOf(new Props(MyActor.class)
.withRouter(new RoundRobinRouter(5).withSupervisorStrategy(strategy)));
//#supervision
}
//#crTest
@Test
@ -123,6 +133,10 @@ public class CustomRouterDocTestBase {
@Override public String routerDispatcher() {
return Dispatchers.DefaultDispatcherId();
}
@Override public SupervisorStrategy supervisorStrategy() {
return SupervisorStrategy.defaultStrategy();
}
//#crRoute
@Override