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 |
BaseKeyedObjectPool<K,V>
A simple base implementation of
KeyedObjectPool . |
private static class |
PoolUtils.CheckedKeyedObjectPool<K,V>
A keyed object pool that performs type checking on objects passed
to pool methods.
|
private static class |
PoolUtils.ErodingKeyedObjectPool<K,V>
Decorates a keyed object pool, adding "eroding" behavior.
|
private static class |
PoolUtils.ErodingPerKeyKeyedObjectPool<K,V>
Extends ErodingKeyedObjectPool to allow erosion to take place on a per-key
basis.
|
private static class |
PoolUtils.KeyedObjectPoolAdaptor<K,V>
Adapts an ObjectPool to implement KeyedObjectPool by ignoring key arguments.
|
private static class |
PoolUtils.SynchronizedKeyedObjectPool<K,V>
A synchronized (thread-safe) KeyedObjectPool backed by the specified KeyedObjectPool.
|
Modifier and Type | Field and Description |
---|---|
private KeyedObjectPool<java.lang.Object,V> |
PoolUtils.ObjectPoolAdaptor.keyedPool
Underlying KeyedObjectPool
|
private KeyedObjectPool<K,V> |
PoolUtils.CheckedKeyedObjectPool.keyedPool
Underlying pool
|
private KeyedObjectPool<K,V> |
PoolUtils.KeyedObjectPoolMinIdleTimerTask.keyedPool
Keyed object pool
|
private KeyedObjectPool<K,V> |
PoolUtils.SynchronizedKeyedObjectPool.keyedPool
Underlying object pool
|
private KeyedObjectPool<K,V> |
PoolUtils.ErodingKeyedObjectPool.keyedPool
Underlying pool
|
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 <K,V> KeyedObjectPool<K,V> |
PoolUtils.checkedPool(KeyedObjectPool<K,V> keyedPool,
java.lang.Class<V> type)
Wraps a
KeyedObjectPool and dynamically checks the type of objects borrowed and returned to the keyedPool. |
KeyedObjectPool<K,V> |
KeyedObjectPoolFactory.createPool()
Create a new
KeyedObjectPool . |
static <K,V> KeyedObjectPool<K,V> |
PoolUtils.erodingPool(KeyedObjectPool<K,V> keyedPool)
Returns a pool that adaptively decreases it's size when idle objects are no longer needed.
|
static <K,V> KeyedObjectPool<K,V> |
PoolUtils.erodingPool(KeyedObjectPool<K,V> keyedPool,
float factor)
Returns a pool that adaptively decreases it's size when idle objects are no longer needed.
|
static <K,V> KeyedObjectPool<K,V> |
PoolUtils.erodingPool(KeyedObjectPool<K,V> keyedPool,
float factor,
boolean perKey)
Returns a pool that adaptively decreases it's size when idle objects are no longer needed.
|
protected KeyedObjectPool<K,V> |
PoolUtils.ErodingKeyedObjectPool.getKeyedPool()
Returns the underlying pool
|
static <K,V> KeyedObjectPool<K,V> |
PoolUtils.synchronizedPool(KeyedObjectPool<K,V> keyedPool)
Returns a synchronized (thread-safe) KeyedObjectPool backed by the specified KeyedObjectPool.
|
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 <K,V> KeyedObjectPool<K,V> |
PoolUtils.checkedPool(KeyedObjectPool<K,V> keyedPool,
java.lang.Class<V> type)
Wraps a
KeyedObjectPool and dynamically checks the type of objects borrowed and returned to the keyedPool. |
static <K,V> java.util.Map<K,java.util.TimerTask> |
PoolUtils.checkMinIdle(KeyedObjectPool<K,V> keyedPool,
java.util.Collection<? extends K> keys,
int minIdle,
long period)
Periodically check the idle object count for each key in the
Collection keys in the keyedPool. |
static <K,V> java.util.TimerTask |
PoolUtils.checkMinIdle(KeyedObjectPool<K,V> keyedPool,
K key,
int minIdle,
long period)
Periodically check the idle object count for the key in the keyedPool.
|
static <K,V> KeyedObjectPool<K,V> |
PoolUtils.erodingPool(KeyedObjectPool<K,V> keyedPool)
Returns a pool that adaptively decreases it's size when idle objects are no longer needed.
|
static <K,V> KeyedObjectPool<K,V> |
PoolUtils.erodingPool(KeyedObjectPool<K,V> keyedPool,
float factor)
Returns a pool that adaptively decreases it's size when idle objects are no longer needed.
|
static <K,V> KeyedObjectPool<K,V> |
PoolUtils.erodingPool(KeyedObjectPool<K,V> keyedPool,
float factor,
boolean perKey)
Returns a pool that adaptively decreases it's size when idle objects are no longer needed.
|
static <K,V> void |
PoolUtils.prefill(KeyedObjectPool<K,V> keyedPool,
java.util.Collection<? extends K> keys,
int count)
Call
addObject(Object) on keyedPool with each key in keys for
count number of times. |
static <K,V> void |
PoolUtils.prefill(KeyedObjectPool<K,V> keyedPool,
K key,
int count)
Call
addObject(Object) on keyedPool with key count
number of times. |
static <K,V> KeyedObjectPool<K,V> |
PoolUtils.synchronizedPool(KeyedObjectPool<K,V> keyedPool)
Returns a synchronized (thread-safe) KeyedObjectPool backed by the specified KeyedObjectPool.
|
Constructor and Description |
---|
CheckedKeyedObjectPool(KeyedObjectPool<K,V> keyedPool,
java.lang.Class<V> type)
Create a new CheckedKeyedObjectPool from the given pool with given expected object type.
|
ErodingKeyedObjectPool(KeyedObjectPool<K,V> keyedPool,
float factor)
Create an ErodingObjectPool wrapping the given pool using the specified erosion factor.
|
ErodingKeyedObjectPool(KeyedObjectPool<K,V> keyedPool,
PoolUtils.ErodingFactor erodingFactor)
Create an ErodingObjectPool wrapping the given pool using the specified erosion factor.
|
ErodingPerKeyKeyedObjectPool(KeyedObjectPool<K,V> keyedPool,
float factor)
Create a new ErordingPerKeyKeyedObjectPool decorating the given keyed pool with
the specified erosion factor.
|
KeyedObjectPoolMinIdleTimerTask(KeyedObjectPool<K,V> keyedPool,
K key,
int minIdle)
Create a new KeyedObjecPoolMinIdleTimerTask.
|
ObjectPoolAdaptor(KeyedObjectPool<java.lang.Object,V> keyedPool,
java.lang.Object key)
Create a new ObjectPoolAdaptor using the provided KeyedObjectPool and fixed key.
|
SynchronizedKeyedObjectPool(KeyedObjectPool<K,V> keyedPool)
Create a new SynchronizedKeyedObjectPool wrapping the given pool
|
Modifier and Type | Class and Description |
---|---|
class |
GenericKeyedObjectPool<K,V>
A configurable
KeyedObjectPool implementation. |
class |
StackKeyedObjectPool<K,V>
A simple,
Stack -based KeyedObjectPool implementation. |
Modifier and Type | Method and Description |
---|---|
KeyedObjectPool<K,V> |
StackKeyedObjectPoolFactory.createPool()
Create a StackKeyedObjectPool with current property settings.
|
KeyedObjectPool<K,V> |
GenericKeyedObjectPoolFactory.createPool()
Create a new GenericKeyedObjectPool with the currently configured properties.
|