Interface ThreadsConfig
- All Superinterfaces:
Config
Configuration of Thread Related Information.
At least one thread pool should be configured, however if none are configured when the server starts then a default pool called "InboundThreadPool" will be created and used as the inbound thread pool.
- Since:
- 4.4
-
Method Summary
Modifier and TypeMethodDescriptionAdd a new thread pool definition.int
Returns the size of the background thread pool.Gets the inbound thread pool definition name.Returns a named thread pool configuration.getPools()
Get the list of thread pool definitions.void
setBackgroundPoolSize
(int size) Sets the number of threads to use for the background thread pool.void
setInboundPool
(String poolDefinition) Sets the thread pool definition to use for the inbound thread pool.
-
Method Details
-
setInboundPool
Sets the thread pool definition to use for the inbound thread pool.This must represent a defined pool.
If no inbound pool is defined when required at runtime then the first pool definition will be used to define it. If there are no pool definitions then a default one will be created.
- Parameters:
poolDefinition
- the inbound thread pool definition- Throws:
ConfigException
- if unable to set the property
-
getInboundPool
String getInboundPool()Gets the inbound thread pool definition name.The inbound pool configuration can be retrieved with
getPool(String)
using the result of this method.Only the
size size
andqueue size
parameters are used to configure the inbound thread pool used by Diffusion. All other parameters are ignored.- Returns:
- definition name or null if not set.
-
setBackgroundPoolSize
Sets the number of threads to use for the background thread pool.If this is not specified then 10 is assumed.
- Parameters:
size
- the number of threads in the background thread pool- Throws:
ConfigException
- if unable to set the background pool size
-
getBackgroundPoolSize
int getBackgroundPoolSize()Returns the size of the background thread pool.- Returns:
- background thread pool size
-
getPools
List<ThreadPoolConfig> getPools()Get the list of thread pool definitions.- Returns:
- list of thread pool definitions which can be empty if none defined.
-
addPool
Add a new thread pool definition.- Parameters:
name
- the name of the definition- Returns:
- the new thread pool configuration
- Throws:
ConfigException
- if unable to add a new thread pool of the given name.
-
getPool
Returns a named thread pool configuration.- Parameters:
name
- the thread pool definition name- Returns:
- the named thread pool definition or null if no definition with the given name exists
-