Class GenericObjectPool.Latch<T>

java.lang.Object
org.apache.commons.pool.impl.GenericObjectPool.Latch<T>
Enclosing class:
GenericObjectPool<T>

private static final class GenericObjectPool.Latch<T> extends Object
Latch used to control allocation order of objects to threads to ensure fairness. That is, objects are allocated to threads in the order that threads request objects.
  • Field Details

  • Constructor Details

    • Latch

      private Latch()
  • Method Details

    • getPair

      Returns ObjectTimestampPair allocated to this latch
      Returns:
      ObjectTimestampPair allocated to this latch
    • setPair

      private void setPair(GenericKeyedObjectPool.ObjectTimestampPair<T> pair)
      Sets ObjectTimestampPair on this latch
      Parameters:
      pair - ObjectTimestampPair allocated to this latch
    • mayCreate

      private boolean mayCreate()
      Whether or not this latch may create an object instance
      Returns:
      true if this latch has an instance creation permit
    • setMayCreate

      private void setMayCreate(boolean mayCreate)
      Sets the mayCreate property
      Parameters:
      mayCreate - new value for mayCreate
    • reset

      private void reset()
      Reset the latch data. Used when an allocation fails and the latch needs to be re-added to the queue.