akka.routing
Class RouteeProvider

java.lang.Object
  extended by akka.routing.RouteeProvider
Direct Known Subclasses:
RemoteRouteeProvider

public class RouteeProvider
extends java.lang.Object

Factory and registry for routees of the router. Uses context.actorOf to create routees from nrOfInstances property and context.actorFor lookup routees from paths.


Constructor Summary
RouteeProvider(ActorContext context, Props routeeProps, scala.Option<Resizer> resizer)
           
 
Method Summary
 ActorContext context()
           
 void createRoutees(int nrOfInstances)
          Creates new routees from specified Props and registers them.
protected  void delayedStop(Scheduler scheduler, scala.collection.immutable.Iterable<ActorRef> abandon, scala.concurrent.duration.FiniteDuration stopDelay)
          Give concurrent messages a chance to be placed in mailbox before sending PoisonPill.
 java.util.List<ActorRef> getRoutees()
          Java API: All routees of the router
 void registerRoutees(scala.collection.immutable.Iterable<ActorRef> routees)
          Adds the routees to the router.
 void registerRoutees(java.lang.Iterable<ActorRef> routees)
          Java API: Adds the routees to the router.
 void registerRouteesFor(scala.collection.immutable.Iterable<java.lang.String> paths)
          Looks up routes with specified paths and registers them.
 void registerRouteesFor(java.lang.Iterable<java.lang.String> paths)
          Java API: Looks up routes with specified paths and registers them.
 void removeRoutees(int nrOfInstances, scala.concurrent.duration.FiniteDuration stopDelay)
          Remove specified number of routees by unregister them and sending PoisonPill after the specified delay.
 scala.Option<Resizer> resizer()
           
 Props routeeProps()
           
 scala.collection.immutable.IndexedSeq<ActorRef> routees()
          All routees of the router
 void unregisterRoutees(scala.collection.immutable.Iterable<ActorRef> routees)
          Removes routees from the router.
 void unregisterRoutees(java.lang.Iterable<ActorRef> routees)
          Java API: Removes routees from the router.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RouteeProvider

public RouteeProvider(ActorContext context,
                      Props routeeProps,
                      scala.Option<Resizer> resizer)
Method Detail

context

public ActorContext context()

routeeProps

public Props routeeProps()

resizer

public scala.Option<Resizer> resizer()

registerRoutees

public void registerRoutees(scala.collection.immutable.Iterable<ActorRef> routees)
Adds the routees to the router. Adds death watch of the routees so that they are removed when terminated. Not thread safe, but intended to be called from protected points, such as RouterConfig.createRoute and Resizer.resize.


registerRoutees

public void registerRoutees(java.lang.Iterable<ActorRef> routees)
Java API: Adds the routees to the router. Adds death watch of the routees so that they are removed when terminated. Not thread safe, but intended to be called from protected points, such as RouterConfig.createRoute and Resizer.resize.


unregisterRoutees

public void unregisterRoutees(scala.collection.immutable.Iterable<ActorRef> routees)
Removes routees from the router. This method doesn't stop the routees. Removes death watch of the routees. Not thread safe, but intended to be called from protected points, such as Resizer.resize.


unregisterRoutees

public void unregisterRoutees(java.lang.Iterable<ActorRef> routees)
Java API: Removes routees from the router. This method doesn't stop the routees. Removes death watch of the routees. Not thread safe, but intended to be called from protected points, such as Resizer.resize.


registerRouteesFor

public void registerRouteesFor(scala.collection.immutable.Iterable<java.lang.String> paths)
Looks up routes with specified paths and registers them.


registerRouteesFor

public void registerRouteesFor(java.lang.Iterable<java.lang.String> paths)
Java API: Looks up routes with specified paths and registers them.


createRoutees

public void createRoutees(int nrOfInstances)
Creates new routees from specified Props and registers them.


removeRoutees

public void removeRoutees(int nrOfInstances,
                          scala.concurrent.duration.FiniteDuration stopDelay)
Remove specified number of routees by unregister them and sending PoisonPill after the specified delay. The reason for the delay is to give concurrent messages a chance to be placed in mailbox before sending PoisonPill.


delayedStop

protected void delayedStop(Scheduler scheduler,
                           scala.collection.immutable.Iterable<ActorRef> abandon,
                           scala.concurrent.duration.FiniteDuration stopDelay)
Give concurrent messages a chance to be placed in mailbox before sending PoisonPill.


routees

public scala.collection.immutable.IndexedSeq<ActorRef> routees()
All routees of the router


getRoutees

public java.util.List<ActorRef> getRoutees()
Java API: All routees of the router