Interface SelectorThreadPoolsConfig
- All Superinterfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The name of the default selector thread pool. -
Method Summary
Modifier and TypeMethodDescriptionAdd a selector thread pool to the set of those available.Returns the name of the default selector thread pool.Returns pool definition with the given name.int
Returns the total count of selector threads configured for all pools.void
setDefaultSelectorThreadPool
(String defaultPoolName) Sets the thread pool definition to use as default selector thread pool.
-
Field Details
-
DEFAULT_NAME
The name of the default selector thread pool.- See Also:
-
-
Method Details
-
setDefaultSelectorThreadPool
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
Add a selector thread pool to the set of those available.- Parameters:
name
- The name of the poolsize
- 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
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.
-