Interface ObjectPool<E extends Poolable>

Type Parameters:
E -
All Superinterfaces:
Pool, Serializable
All Known Implementing Classes:
GenericObjectPool

public interface ObjectPool<E extends Poolable> extends Pool
Since:
0.8
Author:
Haiyang Li
  • Method Details

    • add

      boolean add(E e)
      Parameters:
      e -
      Returns:
      true, if successful
    • add

      boolean add(E e, boolean autoDestroyOnFailedToAdd)
      Parameters:
      e -
      autoDestroyOnFailedToAdd -
      Returns:
      true, if successful
    • add

      boolean add(E e, long timeout, TimeUnit unit) throws InterruptedException
      Parameters:
      e -
      timeout -
      unit -
      Returns:
      true, if successful
      Throws:
      InterruptedException - the interrupted exception
    • add

      boolean add(E e, long timeout, TimeUnit unit, boolean autoDestroyOnFailedToAdd) throws InterruptedException
      Parameters:
      e -
      timeout -
      unit -
      autoDestroyOnFailedToAdd -
      Returns:
      true, if successful
      Throws:
      InterruptedException - the interrupted exception
    • take

      E take()
      Retrieves and removes the head of this queue, or returns null if this queue is empty.
      Returns:
    • take

      E take(long timeout, TimeUnit unit) throws InterruptedException
      Parameters:
      timeout -
      unit -
      Returns:
      Throws:
      InterruptedException - the interrupted exception
    • contains

      boolean contains(E e)
      Parameters:
      e -
      Returns:
      boolean