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
ConstructorsConstructorDescriptionObjectDeque(boolean fairness) Constructs a new ObjectDeque with the given fairness policy. -
Method Summary
Modifier and TypeMethodDescriptionGets all the objects for the current key.Gets the number of instances created - number destroyed.Gets the idle objects for the current key.Gets 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
public 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
Gets all the objects for the current key.- Returns:
- All the objects
-
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
Gets the idle objects for the current key.- Returns:
- The idle objects
-
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
-