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 class GenericKeyedObjectPool.ObjectDeque<S> extends Object
Maintains information on the per key queue for a given key.
  • Field Details

  • 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

      public 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

      public LinkedBlockingDeque<PooledObject<S>> getIdleObjects()
      Gets the idle objects for the current key.
      Returns:
      The idle objects
    • getNumInterested

      public 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 String toString()
      Overrides:
      toString in class Object