private static class PoolUtils.ErodingPerKeyKeyedObjectPool<K,V> extends PoolUtils.ErodingKeyedObjectPool<K,V>
Modifier and Type | Field and Description |
---|---|
private float |
factor
Erosion factor - same for all pools
|
private java.util.Map<K,PoolUtils.ErodingFactor> |
factors
Map of ErodingFactor instances keyed on pool keys
|
Constructor and Description |
---|
ErodingPerKeyKeyedObjectPool(KeyedObjectPool<K,V> keyedPool,
float factor)
Create a new ErordingPerKeyKeyedObjectPool decorating the given keyed pool with
the specified erosion factor.
|
Modifier and Type | Method and Description |
---|---|
protected PoolUtils.ErodingFactor |
getErodingFactor(K key)
Returns the eroding factor for the given key
|
protected int |
numIdle(K key)
Returns the total number of instances currently idle in this pool (optional operation).
|
java.lang.String |
toString() |
addObject, borrowObject, clear, clear, close, getKeyedPool, getNumActive, getNumActive, getNumIdle, getNumIdle, invalidateObject, returnObject, setFactory
private final float factor
private final java.util.Map<K,PoolUtils.ErodingFactor> factors
public ErodingPerKeyKeyedObjectPool(KeyedObjectPool<K,V> keyedPool, float factor)
keyedPool
- underlying keyed poolfactor
- erosion factorprotected int numIdle(K key)
numIdle
in class PoolUtils.ErodingKeyedObjectPool<K,V>
key
- ignoredprotected PoolUtils.ErodingFactor getErodingFactor(K key)
getErodingFactor
in class PoolUtils.ErodingKeyedObjectPool<K,V>
key
- keypublic java.lang.String toString()
toString
in class PoolUtils.ErodingKeyedObjectPool<K,V>