public class FromConfig extends java.lang.Object implements Pool
Props
to mark the actor as externally configurable to be used with a router.
If a Props
is not wrapped with FromConfig
then 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).
Constructor and Description |
---|
FromConfig() |
FromConfig(scala.Option<Resizer> resizer,
SupervisorStrategy supervisorStrategy,
java.lang.String routerDispatcher) |
Modifier and Type | Method and Description |
---|---|
static FromConfig |
apply(scala.Option<Resizer> resizer,
SupervisorStrategy supervisorStrategy,
java.lang.String routerDispatcher) |
Router |
createRouter(ActorSystem system)
Create the actual router, responsible for routing messages to routees.
|
RouterActor |
createRouterActor()
INTERNAL API
|
static Props |
enrichWithPoolDispatcher(Props routeeProps,
ActorContext context) |
static FromConfig$ |
getInstance()
Java API: get the singleton instance
|
static boolean |
isManagementMessage(java.lang.Object msg) |
static Routee |
newRoutee(Props routeeProps,
ActorContext context) |
int |
nrOfInstances(ActorSystem sys)
Initial number of routee instances
|
Props |
props()
Props for a group router based on the settings defined by
this instance. |
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
|
static scala.Option<Props> |
routingLogicController(RoutingLogic routingLogic) |
static boolean |
stopRouterWhenAllRouteesRemoved() |
SupervisorStrategy |
supervisorStrategy()
SupervisorStrategy for the head actor, i.e.
|
static scala.Option<java.lang.String> |
unapply(FromConfig fc) |
static boolean |
usePoolDispatcher() |
void |
verifyConfig(ActorPath path)
Check that everything is there which is needed.
|
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.
|
static RouterConfig |
withFallback(RouterConfig other) |
FromConfig |
withResizer(Resizer resizer)
Setting the resizer to be used.
|
FromConfig |
withSupervisorStrategy(SupervisorStrategy strategy)
Setting the supervisor strategy to be used for the “head” Router actor.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
enrichWithPoolDispatcher, newRoutee, nrOfInstances, props, stopRouterWhenAllRouteesRemoved, usePoolDispatcher
isManagementMessage, routingLogicController, withFallback
public FromConfig(scala.Option<Resizer> resizer, SupervisorStrategy supervisorStrategy, java.lang.String routerDispatcher)
public FromConfig()
public static FromConfig$ getInstance()
public static final FromConfig apply(scala.Option<Resizer> resizer, SupervisorStrategy supervisorStrategy, java.lang.String routerDispatcher)
public static final scala.Option<java.lang.String> unapply(FromConfig fc)
public static scala.Option<Props> routingLogicController(RoutingLogic routingLogic)
public static boolean isManagementMessage(java.lang.Object msg)
public static RouterConfig withFallback(RouterConfig other)
public static boolean usePoolDispatcher()
public static Routee newRoutee(Props routeeProps, ActorContext context)
public static Props enrichWithPoolDispatcher(Props routeeProps, ActorContext context)
public static boolean stopRouterWhenAllRouteesRemoved()
public scala.Option<Resizer> resizer()
Pool
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.public SupervisorStrategy supervisorStrategy()
Pool
supervisorStrategy
in interface Pool
public java.lang.String routerDispatcher()
RouterConfig
routerDispatcher
in interface RouterConfig
public Router createRouter(ActorSystem system)
RouterConfig
createRouter
in interface RouterConfig
system
- the ActorSystem this router belongs topublic RouterActor createRouterActor()
createRouterActor
in interface Pool
createRouterActor
in interface RouterConfig
public void verifyConfig(ActorPath path)
RouterConfig
verifyConfig
in interface RouterConfig
path
- (undocumented)public FromConfig withSupervisorStrategy(SupervisorStrategy strategy)
strategy
- (undocumented)public FromConfig withResizer(Resizer resizer)
resizer
- (undocumented)public FromConfig withDispatcher(java.lang.String dispatcherId)
dispatcherId
- (undocumented)public int nrOfInstances(ActorSystem sys)
Pool
nrOfInstances
in interface Pool
sys
- (undocumented)