Package | Description |
---|---|
org.apache.commons.pool |
Object pooling API.
|
org.apache.commons.pool.impl |
Object pooling API implementations.
|
Modifier and Type | Class and Description |
---|---|
class |
BaseObjectPool<T>
A simple base implementation of
ObjectPool . |
private static class |
PoolUtils.CheckedObjectPool<T>
An object pool that performs type checking on objects passed
to pool methods.
|
private static class |
PoolUtils.ErodingObjectPool<T>
Decorates an object pool, adding "eroding" behavior.
|
private static class |
PoolUtils.ObjectPoolAdaptor<V>
Adapts a KeyedObjectPool to make it an ObjectPool by fixing restricting to
a fixed key.
|
private static class |
PoolUtils.SynchronizedObjectPool<T>
A synchronized (thread-safe) ObjectPool backed by the specified ObjectPool.
|
Modifier and Type | Field and Description |
---|---|
private ObjectPool<V> |
PoolUtils.KeyedObjectPoolAdaptor.pool
Underlying pool
|
private ObjectPool<T> |
PoolUtils.CheckedObjectPool.pool
Underlying object pool
|
private ObjectPool<T> |
PoolUtils.ObjectPoolMinIdleTimerTask.pool
Object pool
|
private ObjectPool<T> |
PoolUtils.SynchronizedObjectPool.pool
the underlying object pool
|
private ObjectPool<T> |
PoolUtils.ErodingObjectPool.pool
Underlying object pool
|
Modifier and Type | Method and Description |
---|---|
static <V> ObjectPool<V> |
PoolUtils.adapt(KeyedObjectPool<java.lang.Object,V> keyedPool)
Adapt a
KeyedObjectPool instance to work where an ObjectPool is needed. |
static <V> ObjectPool<V> |
PoolUtils.adapt(KeyedObjectPool<java.lang.Object,V> keyedPool,
java.lang.Object key)
Adapt a
KeyedObjectPool instance to work where an ObjectPool is needed using the
specified key when delegating. |
static <T> ObjectPool<T> |
PoolUtils.checkedPool(ObjectPool<T> pool,
java.lang.Class<T> type)
Wraps an
ObjectPool and dynamically checks the type of objects borrowed and returned to the pool. |
ObjectPool<T> |
ObjectPoolFactory.createPool()
Create and return a new
ObjectPool . |
static <T> ObjectPool<T> |
PoolUtils.erodingPool(ObjectPool<T> pool)
Returns a pool that adaptively decreases it's size when idle objects are no longer needed.
|
static <T> ObjectPool<T> |
PoolUtils.erodingPool(ObjectPool<T> pool,
float factor)
Returns a pool that adaptively decreases it's size when idle objects are no longer needed.
|
static <T> ObjectPool<T> |
PoolUtils.synchronizedPool(ObjectPool<T> pool)
Returns a synchronized (thread-safe) ObjectPool backed by the specified ObjectPool.
|
Modifier and Type | Method and Description |
---|---|
static <K,V> KeyedObjectPool<K,V> |
PoolUtils.adapt(ObjectPool<V> pool)
Adapt an
ObjectPool to work where an KeyedObjectPool is needed. |
static <T> ObjectPool<T> |
PoolUtils.checkedPool(ObjectPool<T> pool,
java.lang.Class<T> type)
Wraps an
ObjectPool and dynamically checks the type of objects borrowed and returned to the pool. |
static <T> java.util.TimerTask |
PoolUtils.checkMinIdle(ObjectPool<T> pool,
int minIdle,
long period)
Periodically check the idle object count for the pool.
|
static <T> ObjectPool<T> |
PoolUtils.erodingPool(ObjectPool<T> pool)
Returns a pool that adaptively decreases it's size when idle objects are no longer needed.
|
static <T> ObjectPool<T> |
PoolUtils.erodingPool(ObjectPool<T> pool,
float factor)
Returns a pool that adaptively decreases it's size when idle objects are no longer needed.
|
static <T> void |
PoolUtils.prefill(ObjectPool<T> pool,
int count)
Call
addObject() on pool count number of times. |
static <T> ObjectPool<T> |
PoolUtils.synchronizedPool(ObjectPool<T> pool)
Returns a synchronized (thread-safe) ObjectPool backed by the specified ObjectPool.
|
Constructor and Description |
---|
CheckedObjectPool(ObjectPool<T> pool,
java.lang.Class<T> type)
Create a CheckedObjectPool accepting objects of the given type using
the given pool.
|
ErodingObjectPool(ObjectPool<T> pool,
float factor)
Create an ErodingObjectPool wrapping the given pool using the specified erosion factor.
|
KeyedObjectPoolAdaptor(ObjectPool<V> pool)
Create a new KeyedObjectPoolAdaptor wrapping the given ObjectPool
|
ObjectPoolMinIdleTimerTask(ObjectPool<T> pool,
int minIdle)
Create a new ObjectPoolMinIdleTimerTask for the given pool with the given minIdle setting.
|
SynchronizedObjectPool(ObjectPool<T> pool)
Create a new SynchronizedObjectPool wrapping the given pool.
|
Modifier and Type | Class and Description |
---|---|
class |
GenericObjectPool<T>
A configurable
ObjectPool implementation. |
class |
SoftReferenceObjectPool<T>
A
SoftReference based
ObjectPool . |
class |
StackObjectPool<T>
A simple,
Stack -based ObjectPool implementation. |
Modifier and Type | Method and Description |
---|---|
ObjectPool<T> |
GenericObjectPoolFactory.createPool()
Create and return a new
ObjectPool . |
ObjectPool<T> |
StackObjectPoolFactory.createPool()
Create a StackObjectPool.
|