Package akka.routing
Class FromConfig
- java.lang.Object
-
- akka.routing.FromConfig
-
- All Implemented Interfaces:
Pool,RouterConfig,java.io.Serializable
- Direct Known Subclasses:
FromConfig$
public class FromConfig extends java.lang.Object implements Pool
Java API: Wraps aPropsto mark the actor as externally configurable to be used with a router. If aPropsis not wrapped withFromConfigthen the actor will ignore the router part of the deployment section in the configuration.This can be used when the dispatcher to be used for the head Router needs to be configured (defaults to default-dispatcher).
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FromConfig()FromConfig(scala.Option<Resizer> resizer, SupervisorStrategy supervisorStrategy, java.lang.String routerDispatcher)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static FromConfigapply(scala.Option<Resizer> resizer, SupervisorStrategy supervisorStrategy, java.lang.String routerDispatcher)static scala.Option<Resizer>apply$default$1()static SupervisorStrategyapply$default$2()static java.lang.Stringapply$default$3()static booleancanEqual(java.lang.Object x$1)RoutercreateRouter(ActorSystem system)Create the actual router, responsible for routing messages to routees.abstract static booleanequals(java.lang.Object that)static FromConfig$getInstance()Java API: get the singleton instancestatic inthashCode()static booleanisManagementMessage(java.lang.Object msg)intnrOfInstances(ActorSystem sys)Initial number of routee instancesstatic intproductArity()static java.lang.ObjectproductElement(int x$1)static java.lang.StringproductElementName(int n)static scala.collection.Iterator<java.lang.String>productElementNames()static scala.collection.Iterator<java.lang.Object>productIterator()static java.lang.StringproductPrefix()Propsprops()Propsfor a group router based on the settings defined by this instance.scala.Option<Resizer>resizer()Pool with dynamically resizable number of routees return theResizerto use.java.lang.StringrouterDispatcher()Dispatcher ID to use for running the “head” actor, which handles supervision, death watch and router management messagesstatic scala.Option<Props>routingLogicController(RoutingLogic routingLogic)static booleanstopRouterWhenAllRouteesRemoved()SupervisorStrategysupervisorStrategy()SupervisorStrategy for the head actor, i.e.static java.lang.StringtoString()static scala.Option<java.lang.String>unapply(FromConfig fc)static booleanusePoolDispatcher()voidverifyConfig(ActorPath path)Check that everything is there which is needed.FromConfigwithDispatcher(java.lang.String dispatcherId)Setting the dispatcher to be used for the router head actor, which handles supervision, death watch and router management messages.static RouterConfigwithFallback(RouterConfig other)FromConfigwithResizer(Resizer resizer)Setting the resizer to be used.FromConfigwithSupervisorStrategy(SupervisorStrategy strategy)Setting the supervisor strategy to be used for the “head” Router actor.-
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
enrichWithPoolDispatcher, newRoutee, props, stopRouterWhenAllRouteesRemoved, usePoolDispatcher
-
Methods inherited from interface akka.routing.RouterConfig
isManagementMessage, routingLogicController, withFallback
-
-
-
-
Constructor Detail
-
FromConfig
public FromConfig(scala.Option<Resizer> resizer, SupervisorStrategy supervisorStrategy, java.lang.String routerDispatcher)
-
FromConfig
public FromConfig()
-
-
Method Detail
-
getInstance
public static FromConfig$ getInstance()
Java API: get the singleton instance
-
apply
public static final FromConfig apply(scala.Option<Resizer> resizer, SupervisorStrategy supervisorStrategy, java.lang.String routerDispatcher)
-
apply$default$1
public static final scala.Option<Resizer> apply$default$1()
-
apply$default$2
public static final SupervisorStrategy apply$default$2()
-
apply$default$3
public static final java.lang.String apply$default$3()
-
unapply
public static final scala.Option<java.lang.String> unapply(FromConfig fc)
-
productPrefix
public static java.lang.String productPrefix()
-
productArity
public static int productArity()
-
productElement
public static java.lang.Object productElement(int x$1)
-
productIterator
public static scala.collection.Iterator<java.lang.Object> productIterator()
-
canEqual
public static boolean canEqual(java.lang.Object x$1)
-
hashCode
public static int hashCode()
-
toString
public static java.lang.String toString()
-
routingLogicController
public static scala.Option<Props> routingLogicController(RoutingLogic routingLogic)
-
isManagementMessage
public static boolean isManagementMessage(java.lang.Object msg)
-
withFallback
public static RouterConfig withFallback(RouterConfig other)
-
usePoolDispatcher
public static boolean usePoolDispatcher()
-
stopRouterWhenAllRouteesRemoved
public static boolean stopRouterWhenAllRouteesRemoved()
-
equals
public abstract static boolean equals(java.lang.Object that)
-
productElementName
public static java.lang.String productElementName(int n)
-
productElementNames
public static scala.collection.Iterator<java.lang.String> productElementNames()
-
resizer
public scala.Option<Resizer> resizer()
Description copied from interface:PoolPool with dynamically resizable number of routees return theResizerto 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.
-
supervisorStrategy
public SupervisorStrategy supervisorStrategy()
Description copied from interface:PoolSupervisorStrategy for the head actor, i.e. for supervising the routees of the pool.- Specified by:
supervisorStrategyin interfacePool
-
routerDispatcher
public java.lang.String routerDispatcher()
Description copied from interface:RouterConfigDispatcher ID to use for running the “head” actor, which handles supervision, death watch and router management messages- Specified by:
routerDispatcherin interfaceRouterConfig
-
createRouter
public Router createRouter(ActorSystem system)
Description copied from interface:RouterConfigCreate the actual router, responsible for routing messages to routees.- Specified by:
createRouterin interfaceRouterConfig- Parameters:
system- the ActorSystem this router belongs to
-
verifyConfig
public void verifyConfig(ActorPath path)
Description copied from interface:RouterConfigCheck that everything is there which is needed. Called in constructor of RoutedActorRef to fail early.- Specified by:
verifyConfigin interfaceRouterConfig
-
withSupervisorStrategy
public FromConfig withSupervisorStrategy(SupervisorStrategy strategy)
Setting the supervisor strategy to be used for the “head” Router actor.
-
withResizer
public FromConfig withResizer(Resizer resizer)
Setting the resizer to be used.
-
withDispatcher
public FromConfig withDispatcher(java.lang.String dispatcherId)
Setting the dispatcher to be used for the router head actor, which handles supervision, death watch and router management messages.
-
nrOfInstances
public int nrOfInstances(ActorSystem sys)
Description copied from interface:PoolInitial number of routee instances- Specified by:
nrOfInstancesin interfacePool
-
-