Package org.apache.commons.pool2.impl
Class GenericKeyedObjectPool.ObjectDeque<S>
- java.lang.Object
-
- org.apache.commons.pool2.impl.GenericKeyedObjectPool.ObjectDeque<S>
-
- Enclosing class:
- GenericKeyedObjectPool<K,T>
private class GenericKeyedObjectPool.ObjectDeque<S> extends java.lang.Object
Maintains information on the per key queue for a given key.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<BaseGenericObjectPool.IdentityWrapper<S>,PooledObject<S>>
allObjects
private java.util.concurrent.atomic.AtomicInteger
createCount
private LinkedBlockingDeque<PooledObject<S>>
idleObjects
private java.util.concurrent.atomic.AtomicLong
numInterested
-
Constructor Summary
Constructors Constructor Description ObjectDeque(boolean fairness)
Create a new ObjecDeque with the given fairness policy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<BaseGenericObjectPool.IdentityWrapper<S>,PooledObject<S>>
getAllObjects()
Obtain all the objects for the current key.java.util.concurrent.atomic.AtomicInteger
getCreateCount()
Obtain the count of the number of objects created for the current key.LinkedBlockingDeque<PooledObject<S>>
getIdleObjects()
Obtain the idle objects for the current key.java.util.concurrent.atomic.AtomicLong
getNumInterested()
Obtain the number of threads with an interest registered in this key.
-
-
-
Field Detail
-
idleObjects
private final LinkedBlockingDeque<PooledObject<S>> idleObjects
-
createCount
private final java.util.concurrent.atomic.AtomicInteger createCount
-
allObjects
private final java.util.Map<BaseGenericObjectPool.IdentityWrapper<S>,PooledObject<S>> allObjects
-
numInterested
private final java.util.concurrent.atomic.AtomicLong numInterested
-
-
Method Detail
-
getIdleObjects
public LinkedBlockingDeque<PooledObject<S>> getIdleObjects()
Obtain the idle objects for the current key.- Returns:
- The idle objects
-
getCreateCount
public java.util.concurrent.atomic.AtomicInteger getCreateCount()
Obtain the count of the number of objects created for the current key.- Returns:
- The number of objects created for this key
-
getNumInterested
public java.util.concurrent.atomic.AtomicLong getNumInterested()
Obtain the number of threads with an interest registered in this key.- Returns:
- The number of threads with a registered interest in this key
-
getAllObjects
public java.util.Map<BaseGenericObjectPool.IdentityWrapper<S>,PooledObject<S>> getAllObjects()
Obtain all the objects for the current key.- Returns:
- All the objects
-
-