Package org.apache.pekko.routing
Class FromConfig
- java.lang.Object
-
- org.apache.pekko.routing.FromConfig
-
- All Implemented Interfaces:
java.io.Serializable
,Pool
,RouterConfig
- Direct Known Subclasses:
FromConfig$
public class FromConfig extends java.lang.Object implements Pool
Java API: Wraps apekko.actor.Props
to mark the actor as externally configurable to be used with a router. If apekko.actor.Props
is not wrapped withFromConfig
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).
- 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 FromConfig
apply(scala.Option<Resizer> resizer, SupervisorStrategy supervisorStrategy, java.lang.String routerDispatcher)
static scala.Option<Resizer>
apply$default$1()
static SupervisorStrategy
apply$default$2()
static java.lang.String
apply$default$3()
static boolean
canEqual(java.lang.Object x$1)
Router
createRouter(ActorSystem system)
Create the actual router, responsible for routing messages to routees.abstract static boolean
equals(java.lang.Object that)
static FromConfig$
getInstance()
Java API: get the singleton instancestatic int
hashCode()
static boolean
isManagementMessage(java.lang.Object msg)
int
nrOfInstances(ActorSystem sys)
Initial number of routee instancesstatic int
productArity()
static java.lang.Object
productElement(int x$1)
static java.lang.String
productElementName(int n)
static scala.collection.Iterator<java.lang.String>
productElementNames()
static scala.collection.Iterator<java.lang.Object>
productIterator()
static java.lang.String
productPrefix()
Props
props()
pekko.actor.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 thepekko.routing.Resizer
to use.java.lang.String
routerDispatcher()
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 boolean
stopRouterWhenAllRouteesRemoved()
SupervisorStrategy
supervisorStrategy()
SupervisorStrategy for the head actor, i.e.static java.lang.String
toString()
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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pekko.routing.Pool
enrichWithPoolDispatcher, newRoutee, props, stopRouterWhenAllRouteesRemoved, usePoolDispatcher
-
Methods inherited from interface org.apache.pekko.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:Pool
Pool with dynamically resizable number of routees return thepekko.routing.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.
-
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 interfacePool
-
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 interfaceRouterConfig
-
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 interfaceRouterConfig
- Parameters:
system
- the ActorSystem this router belongs to
-
verifyConfig
public void verifyConfig(ActorPath path)
Description copied from interface:RouterConfig
Check that everything is there which is needed. Called in constructor of RoutedActorRef to fail early.- Specified by:
verifyConfig
in 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:Pool
Initial number of routee instances- Specified by:
nrOfInstances
in interfacePool
-
props
public Props props()
pekko.actor.Props
for a group router based on the settings defined by this instance.
-
-