Class ConcurrentPool.ConcurrentEntry<E>

java.lang.Object
org.eclipse.jetty.util.ConcurrentPool.ConcurrentEntry<E>
All Implemented Interfaces:
Pool.Entry<E>
Enclosing class:
ConcurrentPool<P>

public static class ConcurrentPool.ConcurrentEntry<E> extends Object implements Pool.Entry<E>

A Pool entry that holds metadata and a pooled object.

  • Constructor Details

  • Method Details

    • enable

      public boolean enable(E pooled, boolean acquire)
      Description copied from interface: Pool.Entry

      Enables this, previously reserved, Entry.

      An entry returned from the Pool.reserve() method must be enabled with this method, once and only once, before it is usable by the pool.

      The entry may be enabled and not acquired, in which case it is immediately available to be acquired, potentially by another thread; or it can be enabled and acquired atomically so that no other thread can acquire it, although the acquire may still fail if the pool has been terminated.

      Specified by:
      enable in interface Pool.Entry<E>
      Parameters:
      pooled - the pooled object for this Entry
      acquire - whether this Entry should be atomically enabled and acquired
      Returns:
      whether this Entry was enabled
    • getPooled

      public E getPooled()
      Specified by:
      getPooled in interface Pool.Entry<E>
      Returns:
      the pooled object
    • release

      public boolean release()
      Description copied from interface: Pool.Entry

      Releases this Entry to the Pool.

      Specified by:
      release in interface Pool.Entry<E>
      Returns:
      whether this Entry was released
    • remove

      public boolean remove()
      Description copied from interface: Pool.Entry

      Removes this Entry from the Pool.

      Specified by:
      remove in interface Pool.Entry<E>
      Returns:
      whether this Entry was removed
    • isTerminated

      public boolean isTerminated()
      Specified by:
      isTerminated in interface Pool.Entry<E>
      Returns:
      whether this Entry is terminated
    • isReserved

      public boolean isReserved()
      Specified by:
      isReserved in interface Pool.Entry<E>
      Returns:
      whether this Entry is reserved
      See Also:
    • isIdle

      public boolean isIdle()
      Specified by:
      isIdle in interface Pool.Entry<E>
      Returns:
      whether this Entry is idle in the Pool
    • isInUse

      public boolean isInUse()
      Specified by:
      isInUse in interface Pool.Entry<E>
      Returns:
      whether this Entry is in use
    • toString

      public String toString()
      Overrides:
      toString in class Object