akka.cluster.routing
Class ClusterRouterConfig

java.lang.Object
  extended by akka.cluster.routing.ClusterRouterConfig
All Implemented Interfaces:
RouterConfig, java.io.Serializable, scala.Equals, scala.Product

public final class ClusterRouterConfig
extends java.lang.Object
implements RouterConfig, scala.Product, scala.Serializable

RouterConfig implementation for deployment on cluster nodes. Delegates other duties to the local RouterConfig, which makes it possible to mix this with the built-in routers such as RoundRobinRouter or custom routers.

See Also:
Serialized Form

Constructor Summary
ClusterRouterConfig(RouterConfig local, ClusterRouterSettings settings)
           
 
Method Summary
 Router createActor()
          The router "head" actor.
 scala.PartialFunction<scala.Tuple2<ActorRef,java.lang.Object>,scala.collection.immutable.Iterable<Destination>> createRoute(RouteeProvider routeeProvider)
          Implement the routing logic by returning a partial function of partial function from (sender, message) to a set of destinations.
 akka.cluster.routing.ClusterRouteeProvider createRouteeProvider(ActorContext context, Props routeeProps)
          The RouteeProvider responsible for creating or looking up routees.
 RouterConfig local()
           
 scala.Option<Resizer> resizer()
          Routers with dynamically resizable number of routees return the Resizer to use.
 java.lang.String routerDispatcher()
          Dispatcher ID to use for running the “head” actor, i.e.
 ClusterRouterSettings settings()
           
 boolean stopRouterWhenAllRouteesRemoved()
           
 SupervisorStrategy supervisorStrategy()
          SupervisorStrategy for the created Router actor.
 RouterConfig withFallback(RouterConfig other)
          Overridable merge strategy, by default completely prefers “this” (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface akka.routing.RouterConfig
toAll, verifyConfig
 
Methods inherited from interface scala.Product
productArity, productElement, productIterator, productPrefix
 
Methods inherited from interface scala.Equals
canEqual, equals
 

Constructor Detail

ClusterRouterConfig

public ClusterRouterConfig(RouterConfig local,
                           ClusterRouterSettings settings)
Method Detail

local

public RouterConfig local()

settings

public ClusterRouterSettings settings()

createRouteeProvider

public akka.cluster.routing.ClusterRouteeProvider createRouteeProvider(ActorContext context,
                                                                       Props routeeProps)
Description copied from interface: RouterConfig
The RouteeProvider responsible for creating or looking up routees. It's used in createRoute to register routees, and also from Resizer.

Specified by:
createRouteeProvider in interface RouterConfig

createRoute

public scala.PartialFunction<scala.Tuple2<ActorRef,java.lang.Object>,scala.collection.immutable.Iterable<Destination>> createRoute(RouteeProvider routeeProvider)
Description copied from interface: RouterConfig
Implement the routing logic by returning a partial function of partial function from (sender, message) to a set of destinations. This Route will be applied for each incoming message.

When createRoute is called the routees should also be registered, typically by using createRoutees or registerRouteesFor of the supplied RouteeProvider.

Specified by:
createRoute in interface RouterConfig

createActor

public Router createActor()
Description copied from interface: RouterConfig
The router "head" actor.

Specified by:
createActor in interface RouterConfig

supervisorStrategy

public SupervisorStrategy supervisorStrategy()
Description copied from interface: RouterConfig
SupervisorStrategy for the created Router actor.

Specified by:
supervisorStrategy in interface RouterConfig

routerDispatcher

public java.lang.String routerDispatcher()
Description copied from interface: RouterConfig
Dispatcher ID to use for running the “head” actor, i.e. the Router.

Specified by:
routerDispatcher in interface RouterConfig

resizer

public scala.Option<Resizer> resizer()
Description copied from interface: RouterConfig
Routers with dynamically resizable number of routees return the Resizer to use. The resizer is invoked once when the router is created, before any messages can be sent to it. Resize is also triggered when messages are sent to the routees, and the resizer is invoked asynchronously, i.e. not necessarily before the message has been sent.

Specified by:
resizer in interface RouterConfig

stopRouterWhenAllRouteesRemoved

public boolean stopRouterWhenAllRouteesRemoved()
Specified by:
stopRouterWhenAllRouteesRemoved in interface RouterConfig

withFallback

public RouterConfig withFallback(RouterConfig other)
Description copied from interface: RouterConfig
Overridable merge strategy, by default completely prefers “this” (i.e. no merge).

Specified by:
withFallback in interface RouterConfig