Package com.landawn.abacus.pool
Class GenericObjectPool<E extends Poolable>
java.lang.Object
com.landawn.abacus.pool.AbstractPool
com.landawn.abacus.pool.GenericObjectPool<E>
- Type Parameters:
E
-
- All Implemented Interfaces:
ObjectPool<E>
,Pool
,Serializable
- Since:
- 0.8
- Author:
- Haiyang Li
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.landawn.abacus.pool.ObjectPool
ObjectPool.MemoryMeasure<E>
-
Method Summary
Methods inherited from class com.landawn.abacus.pool.AbstractPool
evictionCount, getCapacity, hitCount, isClosed, isEmpty, lock, missCount, putCount, unlock
Methods inherited from interface com.landawn.abacus.pool.Pool
evictionCount, getCapacity, hitCount, isClosed, isEmpty, lock, missCount, putCount, unlock
-
Method Details
-
add
- Specified by:
add
in interfaceObjectPool<E extends Poolable>
- Parameters:
e
-- Returns:
- true, if successful
-
add
- Specified by:
add
in interfaceObjectPool<E extends Poolable>
- Parameters:
e
-autoDestroyOnFailedToAdd
-- Returns:
- true, if successful
-
add
- Specified by:
add
in interfaceObjectPool<E extends Poolable>
- Parameters:
e
-timeout
-unit
-- Returns:
- true, if successful
- Throws:
InterruptedException
- the interrupted exception
-
add
public boolean add(E e, long timeout, TimeUnit unit, boolean autoDestroyOnFailedToAdd) throws InterruptedException - Specified by:
add
in interfaceObjectPool<E extends Poolable>
- Parameters:
e
-timeout
-unit
-autoDestroyOnFailedToAdd
-- Returns:
- true, if successful
- Throws:
InterruptedException
- the interrupted exception
-
take
Description copied from interface:ObjectPool
Retrieves and removes the head of this queue, or returns null if this queue is empty.- Specified by:
take
in interfaceObjectPool<E extends Poolable>
- Returns:
-
take
- Specified by:
take
in interfaceObjectPool<E extends Poolable>
- Parameters:
timeout
-unit
-- Returns:
- Throws:
InterruptedException
- the interrupted exception
-
contains
- Specified by:
contains
in interfaceObjectPool<E extends Poolable>
- Parameters:
e
-- Returns:
- true, if successful
-
vacate
public void vacate()Vacate. -
clear
public void clear()Clear. -
close
public void close()Close. -
size
public int size() -
hashCode
public int hashCode() -
equals
-
toString
-