Package akka.routing

Class FromConfig

  • All Implemented Interfaces:
    Pool, RouterConfig, java.io.Serializable, scala.Serializable
    Direct Known Subclasses:
    FromConfig$

    public class FromConfig
    extends java.lang.Object
    implements Pool
    Java API: Wraps a 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).

    See Also:
    Serialized Form
    • 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
        Returns:
        (undocumented)
      • apply$default$1

        public static final scala.Option<Resizer> apply$default$1()
      • 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)
      • usePoolDispatcher

        public static boolean usePoolDispatcher()
      • enrichWithPoolDispatcher

        public static Props enrichWithPoolDispatcher​(Props routeeProps,
                                                     ActorContext context)
      • stopRouterWhenAllRouteesRemoved

        public static boolean stopRouterWhenAllRouteesRemoved()
      • 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
        Returns:
        (undocumented)
      • 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
        Returns:
        (undocumented)
      • routerDispatcher

        public java.lang.String routerDispatcher()
        Description copied from interface: RouterConfig
        Dispatcher ID to use for running the &ldquo;head&rdquo; actor, which handles supervision, death watch and router management messages
        Specified by:
        routerDispatcher in interface RouterConfig
        Returns:
        (undocumented)
      • 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
        Returns:
        (undocumented)
      • 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 interface RouterConfig
        Parameters:
        path - (undocumented)
      • withSupervisorStrategy

        public FromConfig withSupervisorStrategy​(SupervisorStrategy strategy)
        Setting the supervisor strategy to be used for the &ldquo;head&rdquo; Router actor.
        Parameters:
        strategy - (undocumented)
        Returns:
        (undocumented)
      • withResizer

        public FromConfig withResizer​(Resizer resizer)
        Setting the resizer to be used.
        Parameters:
        resizer - (undocumented)
        Returns:
        (undocumented)
      • 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.
        Parameters:
        dispatcherId - (undocumented)
        Returns:
        (undocumented)
      • nrOfInstances

        public int nrOfInstances​(ActorSystem sys)
        Description copied from interface: Pool
        Initial number of routee instances
        Specified by:
        nrOfInstances in interface Pool
        Parameters:
        sys - (undocumented)
        Returns:
        (undocumented)
      • props

        public Props props()
        Props for a group router based on the settings defined by this instance.
        Returns:
        (undocumented)