Handle remote routers transparently. See #1606

* RemoteRouterConfig wrapper with RemoteRouteeProvider instead if fixed remote routers.
* Had to refactor and introduce RouteeProvider for different implementations of how to create routees.
* Works with Resizer also.
* Added some tests.
This commit is contained in:
Patrik Nordwall 2012-01-17 08:45:07 +01:00
parent 0cf5c22eac
commit e7a0247c0d
6 changed files with 189 additions and 243 deletions

View file

@ -107,13 +107,13 @@ public class CustomRouterDocTestBase {
//#crRoute
@Override
public CustomRoute createCustomRoute(Props props, ActorContext context) {
final ActorRef democratActor = context.actorOf(new Props(DemocratActor.class), "d");
final ActorRef republicanActor = context.actorOf(new Props(RepublicanActor.class), "r");
public CustomRoute createCustomRoute(Props props, RouteeProvider routeeProvider) {
final ActorRef democratActor = routeeProvider.context().actorOf(new Props(DemocratActor.class), "d");
final ActorRef republicanActor = routeeProvider.context().actorOf(new Props(RepublicanActor.class), "r");
List<ActorRef> routees = Arrays.asList(new ActorRef[] { democratActor, republicanActor });
//#crRegisterRoutees
registerRoutees(context, routees);
routeeProvider.registerRoutees(routees);
//#crRegisterRoutees
//#crRoutingLogic