public interface SelectorThreadPoolsConfig extends Config
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.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_NAME
The name of the default selector thread pool.
|
Modifier and Type | Method and Description |
---|---|
SelectorThreadPoolConfig |
addPool(String name,
int size)
Add a selector thread pool to the set of those available.
|
String |
getDefaultPool()
Returns the name of the default selector thread pool.
|
SelectorThreadPoolConfig |
getPool(String poolName)
Returns pool definition with the given name.
|
int |
getSelectorThreadCount()
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.
|
static final String DEFAULT_NAME
void setDefaultSelectorThreadPool(String defaultPoolName) throws ConfigException
This must represent a defined pool.
defaultPoolName
- The name of the default selector thread poolConfigException
- if no pool has been defined with the given nameSelectorThreadPoolConfig addPool(String name, int size) throws ConfigException
name
- The name of the poolsize
- the number of threads in the poolConfigException
- if:
- name is either empty or null
- size < 1 or size > Integer.MAX_VALUE
- a pool with the given name already exists.
String getDefaultPool()
SelectorThreadPoolConfig getPool(String poolName)
poolName
- the selector pool's nameint getSelectorThreadCount()
Copyright © 2022 Push Technology Ltd. All Rights Reserved.