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>
Maintains information on the per key queue for a given key.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<BaseGenericObjectPool.IdentityWrapper<S>, PooledObject<S>> private final AtomicIntegerprivate final LinkedBlockingDeque<PooledObject<S>> private longprivate final Objectprivate final AtomicLong -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateObjectDeque(boolean fairness) Constructs a new ObjectDeque with the given fairness policy. -
Method Summary
Modifier and TypeMethodDescription(package private) Map<BaseGenericObjectPool.IdentityWrapper<S>, PooledObject<S>> Gets all the objects for the current key.(package private) AtomicIntegerGets the number of instances created - number destroyed.(package private) LinkedBlockingDeque<PooledObject<S>> Gets the idle objects for the current key.(package private) AtomicLongGets the number of threads with an interest registered in this key.toString()
-
Field Details
-
idleObjects
-
createCount
-
makeObjectCount
private long makeObjectCount -
makeObjectCountLock
-
allObjects
-
numInterested
-
-
Constructor Details
-
ObjectDeque
private ObjectDeque(boolean fairness) Constructs a new ObjectDeque with the given fairness policy.- Parameters:
fairness- true means client threads waiting to borrow / return instances will be served as if waiting in a FIFO queue.
-
-
Method Details
-
getAllObjects
Map<BaseGenericObjectPool.IdentityWrapper<S>,PooledObject<S>> getAllObjects()Gets all the objects for the current key.- Returns:
- All the objects.
-
getCreateCount
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
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
-