Class GenericKeyedObjectPool.ObjectDeque<S>
java.lang.Object
org.datanucleus.store.rdbms.datasource.dbcp2.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 AtomicInteger
private final LinkedBlockingDeque
<PooledObject<S>> private long
private final Object
private final AtomicLong
-
Constructor Summary
ConstructorsConstructorDescriptionObjectDeque
(boolean fairness) Create a new ObjecDeque with the given fairness policy. -
Method Summary
Modifier and TypeMethodDescriptionObtain all the objects for the current key.Obtain the count of the number of objects created for the current key.Obtain the idle objects for the current key.Obtain 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) Create a new ObjecDeque 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
-
getIdleObjects
Obtain the idle objects for the current key.- Returns:
- The idle objects
-
getCreateCount
Obtain the count of the number of objects created for the current key.- Returns:
- The number of objects created for this key
-
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
Obtain all the objects for the current key.- Returns:
- All the objects
-
toString
-