Class ThreadPool
java.lang.Object
org.apache.commons.pool.BaseObjectPool<T>
org.apache.commons.pool.impl.GenericObjectPool
de.hybris.platform.util.threadpool.ThreadPool
- All Implemented Interfaces:
AutoCloseable,org.apache.commons.pool.ObjectPool
public class ThreadPool
extends org.apache.commons.pool.impl.GenericObjectPool
implements AutoCloseable
A pool of Threads. The threads from this pool are used to launch the tasks.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.commons.pool.impl.GenericObjectPool
org.apache.commons.pool.impl.GenericObjectPool.Config -
Field Summary
FieldsFields inherited from class org.apache.commons.pool.impl.GenericObjectPool
DEFAULT_LIFO, DEFAULT_MAX_ACTIVE, DEFAULT_MAX_IDLE, DEFAULT_MAX_WAIT, DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_MIN_IDLE, DEFAULT_NUM_TESTS_PER_EVICTION_RUN, DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_TEST_ON_BORROW, DEFAULT_TEST_ON_RETURN, DEFAULT_TEST_WHILE_IDLE, DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS, DEFAULT_WHEN_EXHAUSTED_ACTION, WHEN_EXHAUSTED_BLOCK, WHEN_EXHAUSTED_FAIL, WHEN_EXHAUSTED_GROW -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Objectfinal PoolableThreadvoidclose()static ThreadPoolfinal voidreturnObject(Object thread) final voidreturnThread(PoolableThread thread) Methods inherited from class org.apache.commons.pool.impl.GenericObjectPool
addObject, clear, evict, getLifo, getMaxActive, getMaxIdle, getMaxWait, getMinEvictableIdleTimeMillis, getMinIdle, getNumActive, getNumIdle, getNumTestsPerEvictionRun, getSoftMinEvictableIdleTimeMillis, getTestOnBorrow, getTestOnReturn, getTestWhileIdle, getTimeBetweenEvictionRunsMillis, getWhenExhaustedAction, invalidateObject, setConfig, setFactory, setLifo, setMaxActive, setMaxIdle, setMaxWait, setMinEvictableIdleTimeMillis, setMinIdle, setNumTestsPerEvictionRun, setSoftMinEvictableIdleTimeMillis, setTestOnBorrow, setTestOnReturn, setTestWhileIdle, setTimeBetweenEvictionRunsMillis, setWhenExhaustedAction, startEvictorMethods inherited from class org.apache.commons.pool.BaseObjectPool
assertOpen, isClosed
-
Field Details
-
DEFAULT_MAX_THREADS
public static final int DEFAULT_MAX_THREADS- See Also:
-
-
Constructor Details
-
ThreadPool
-
-
Method Details
-
getInstance
-
borrowObject
- Specified by:
borrowObjectin interfaceorg.apache.commons.pool.ObjectPool- Overrides:
borrowObjectin classorg.apache.commons.pool.impl.GenericObjectPool
-
returnObject
- Specified by:
returnObjectin interfaceorg.apache.commons.pool.ObjectPool- Overrides:
returnObjectin classorg.apache.commons.pool.impl.GenericObjectPool- Throws:
Exception
-
returnThread
- Throws:
Exception
-
borrowThread
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceorg.apache.commons.pool.ObjectPool- Overrides:
closein classorg.apache.commons.pool.impl.GenericObjectPool
-