Package org.apache.sling.commons.threads
Interface ThreadPoolManager
@ProviderType
public interface ThreadPoolManager
The
ThreadPoolManager
manages thread pools.-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(ThreadPoolConfig config) Create a new thread pool with this configuration.create
(ThreadPoolConfig config, String label) Create a new thread pool with this configuration.Get a thread pool.void
release
(ThreadPool pool) Release the thread pool again.
-
Field Details
-
DEFAULT_THREADPOOL_NAME
The default thread pool name- See Also:
-
-
Method Details
-
get
Get a thread pool. If there is no thread pool with the given name, a new thread pool with the default configuration is created and returned. A thread pool must be released when not used anymore with therelease(ThreadPool)
method.- Parameters:
name
- The name of the thread pool or null for the default pool.- Returns:
- A thread pool.
-
create
Create a new thread pool with this configuration. A thread pool must be released when not used anymore with therelease(ThreadPool)
method.- Parameters:
config
- The thread pool configuration.- Returns:
- A new thread pool.
-
create
Create a new thread pool with this configuration. A thread pool must be released when not used anymore with therelease(ThreadPool)
method.- Parameters:
config
- The thread pool configuration.label
- An optional label for the thread pool. The label will be appended to the name of the pool.- Returns:
- A new thread pool.
- Since:
- 3.1
-
release
Release the thread pool again.- Parameters:
pool
- The thread pool to release
-