Interface SelectorThreadPoolsConfig

All Superinterfaces:
Config

public interface SelectorThreadPoolsConfig extends Config
Selector thread pools configuration.

This allows the user to add and retrieve pools of selector threads, and also define what the default pool should be.

By default there is a single pool of size 1 called "SelectorThreadPool" and that is the default.

Since:
5.5
  • Field Details

  • Method Details

    • setDefaultSelectorThreadPool

      void setDefaultSelectorThreadPool(String defaultPoolName) throws ConfigException
      Sets the thread pool definition to use as default selector thread pool.

      This must represent a defined pool.

      Parameters:
      defaultPoolName - The name of the default selector thread pool
      Throws:
      ConfigException - if no pool has been defined with the given name
    • addPool

      SelectorThreadPoolConfig addPool(String name, int size) throws ConfigException
      Add a selector thread pool to the set of those available.
      Parameters:
      name - The name of the pool
      size - the number of threads in the pool
      Returns:
      the pool added
      Throws:
      ConfigException - if:

      - name is either empty or null

      - size < 1 or size > Integer.MAX_VALUE

      - a pool with the given name already exists.

    • getDefaultPool

      String getDefaultPool()
      Returns the name of the default selector thread pool.
      Returns:
      the default selector thread pool name
    • getPool

      SelectorThreadPoolConfig getPool(String poolName)
      Returns pool definition with the given name.
      Parameters:
      poolName - the selector pool's name
      Returns:
      the pool associated or null if such a pool does not exist
    • getSelectorThreadCount

      int getSelectorThreadCount()
      Returns the total count of selector threads configured for all pools.
      Returns:
      the count of all selector threads.