akka.cluster.routing
Class ClusterRouterPool

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

public final class ClusterRouterPool
extends java.lang.Object
implements Pool, 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
ClusterRouterPool(Pool local, ClusterRouterPoolSettings settings)
           
 
Method Summary
 Router createRouter(ActorSystem system)
          Create the actual router, responsible for routing messages to routees.
 boolean isManagementMessage(java.lang.Object msg)
          Is the message handled by the router head actor or the RouterConfig.routingLogicController(akka.routing.RoutingLogic) actor.
 Pool local()
           
 int nrOfInstances()
          Initial number of routee instances
 scala.Option<Resizer> resizer()
          Pool with dynamically resizable number of routees return the Resizer to use.
 java.lang.String routerDispatcher()
          Dispatcher ID to use for running the “head” actor, which handles supervision, death watch and router management messages
 scala.Option<Props> routingLogicController(RoutingLogic routingLogic)
          Possibility to define an actor for controlling the routing logic from external stimuli (e.g.
 ClusterRouterPoolSettings settings()
           
 boolean stopRouterWhenAllRouteesRemoved()
           
 SupervisorStrategy supervisorStrategy()
          SupervisorStrategy for the head actor, i.e.
 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.Pool
defaultSupervisorStrategy, enrichWithPoolDispatcher, props, stopRouterWhenAllRouteesRemoved, usePoolDispatcher
 
Methods inherited from interface akka.routing.RouterConfig
verifyConfig
 
Methods inherited from interface scala.Product
productArity, productElement, productIterator, productPrefix
 
Methods inherited from interface scala.Equals
canEqual, equals
 

Constructor Detail

ClusterRouterPool

public ClusterRouterPool(Pool local,
                         ClusterRouterPoolSettings settings)
Method Detail

local

public Pool local()

settings

public ClusterRouterPoolSettings settings()

nrOfInstances

public int nrOfInstances()
Initial number of routee instances

Specified by:
nrOfInstances in interface Pool

resizer

public scala.Option<Resizer> resizer()
Description copied from interface: Pool
Pool 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 Pool

supervisorStrategy

public SupervisorStrategy supervisorStrategy()
Description copied from interface: Pool
SupervisorStrategy for the head actor, i.e. for supervising the routees of the pool.

Specified by:
supervisorStrategy in interface Pool

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

createRouter

public Router createRouter(ActorSystem system)
Description copied from interface: RouterConfig
Create the actual router, responsible for routing messages to routees.

Specified by:
createRouter in interface RouterConfig
Parameters:
system - the ActorSystem this router belongs to

routerDispatcher

public java.lang.String routerDispatcher()
Description copied from interface: RouterConfig
Dispatcher ID to use for running the “head” actor, which handles supervision, death watch and router management messages

Specified by:
routerDispatcher in interface RouterConfig

stopRouterWhenAllRouteesRemoved

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

routingLogicController

public scala.Option<Props> routingLogicController(RoutingLogic routingLogic)
Description copied from interface: RouterConfig
Possibility to define an actor for controlling the routing logic from external stimuli (e.g. monitoring metrics). This actor will be a child of the router "head" actor. Managment messages not handled by the "head" actor are delegated to this controller actor.

Specified by:
routingLogicController in interface RouterConfig

isManagementMessage

public boolean isManagementMessage(java.lang.Object msg)
Description copied from interface: RouterConfig
Is the message handled by the router head actor or the RouterConfig.routingLogicController(akka.routing.RoutingLogic) actor.

Specified by:
isManagementMessage in interface RouterConfig