Package org.apache.commons.pool2.impl
Class GenericKeyedObjectPool.ObjectDeque<S>
- java.lang.Object
-
- org.apache.commons.pool2.impl.GenericKeyedObjectPool.ObjectDeque<S>
-
- Type Parameters:
S- type of objects in the pool
- Enclosing class:
- GenericKeyedObjectPool<K,T>
private static final class GenericKeyedObjectPool.ObjectDeque<S> extends java.lang.ObjectMaintains 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>>allObjectsprivate java.util.concurrent.atomic.AtomicIntegercreateCountprivate LinkedBlockingDeque<PooledObject<S>>idleObjectsprivate longmakeObjectCountprivate java.lang.ObjectmakeObjectCountLockprivate java.util.concurrent.atomic.AtomicLongnumInterested
-
Constructor Summary
Constructors Modifier Constructor Description privateObjectDeque(boolean fairness)Constructs a new ObjectDeque with the given fairness policy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.util.Map<BaseGenericObjectPool.IdentityWrapper<S>,PooledObject<S>>getAllObjects()Gets all the objects for the current key.(package private) java.util.concurrent.atomic.AtomicIntegergetCreateCount()Gets the number of instances created - number destroyed.(package private) LinkedBlockingDeque<PooledObject<S>>getIdleObjects()Gets the idle objects for the current key.(package private) java.util.concurrent.atomic.AtomicLonggetNumInterested()Gets the number of threads with an interest registered in this key.java.lang.StringtoString()
-
-
-
Field Detail
-
idleObjects
private final LinkedBlockingDeque<PooledObject<S>> idleObjects
-
createCount
private final java.util.concurrent.atomic.AtomicInteger createCount
-
makeObjectCount
private long makeObjectCount
-
makeObjectCountLock
private final java.lang.Object makeObjectCountLock
-
allObjects
private final java.util.Map<BaseGenericObjectPool.IdentityWrapper<S>,PooledObject<S>> allObjects
-
numInterested
private final java.util.concurrent.atomic.AtomicLong numInterested
-
-
Method Detail
-
getAllObjects
java.util.Map<BaseGenericObjectPool.IdentityWrapper<S>,PooledObject<S>> getAllObjects()
Gets all the objects for the current key.- Returns:
- All the objects.
-
getCreateCount
java.util.concurrent.atomic.AtomicInteger getCreateCount()
Gets the number of instances created - number destroyed. Should always be less than or equal to maxTotalPerKey.- Returns:
- The net instance addition count for this deque.
-
getIdleObjects
LinkedBlockingDeque<PooledObject<S>> getIdleObjects()
Gets the idle objects for the current key.- Returns:
- The idle objects.
-
getNumInterested
java.util.concurrent.atomic.AtomicLong getNumInterested()
Gets the number of threads with an interest registered in this key.- Returns:
- The number of threads with a registered interest in this key.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-