Class GenericObjectPool.Latch<T>

  • Enclosing class:
    GenericObjectPool<T>

    private static final class GenericObjectPool.Latch<T>
    extends java.lang.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.
    • Constructor Detail

      • Latch

        private Latch()
    • Method Detail

      • 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.