| Package | Description |
|---|---|
| org.apache.commons.pool2 |
Object pooling API.
|
| org.apache.commons.pool2.impl |
Object pooling API implementations.
|
| org.apache.commons.pool2.proxy |
Object pooling proxy implementation.
|
| Modifier and Type | Class and Description |
|---|---|
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.SynchronizedKeyedObjectPool<K,V>
A synchronized (thread-safe) KeyedObjectPool backed by the specified
KeyedObjectPool.
|
| Modifier and Type | Field and Description |
|---|---|
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.erodingPool(KeyedObjectPool<K,V> keyedPool)
Returns a pool that adaptively decreases its 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 its 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 its 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 <K,V> java.util.Map<K,java.util.TimerTask> |
PoolUtils.checkMinIdle(KeyedObjectPool<K,V> keyedPool,
java.util.Collection<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 its 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 its 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 its size when idle objects are
no longer needed.
|
static <K,V> void |
PoolUtils.prefill(KeyedObjectPool<K,V> keyedPool,
java.util.Collection<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 |
|---|
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.
|
SynchronizedKeyedObjectPool(KeyedObjectPool<K,V> keyedPool)
Create a new SynchronizedKeyedObjectPool wrapping the given pool
|
| Modifier and Type | Class and Description |
|---|---|
class |
GenericKeyedObjectPool<K,T>
A configurable
KeyedObjectPool implementation. |
| Modifier and Type | Class and Description |
|---|---|
class |
ProxiedKeyedObjectPool<K,V>
Create a new keyed object pool where the pooled objects are wrapped in
proxies allowing better control of pooled objects and in particular the
prevention of the continued use of an object by a client after that client
returns the object to the pool.
|
| Modifier and Type | Field and Description |
|---|---|
private KeyedObjectPool<K,V> |
ProxiedKeyedObjectPool.pool |
| Constructor and Description |
|---|
ProxiedKeyedObjectPool(KeyedObjectPool<K,V> pool,
ProxySource<V> proxySource)
Create a new proxied object pool.
|