Package com.landawn.abacus.pool
Interface ObjectPool<E extends Poolable>
- Type Parameters:
E
-
- All Superinterfaces:
Pool
,Serializable
- All Known Implementing Classes:
GenericObjectPool
- Since:
- 0.8
- Author:
- Haiyang Li
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
The Interface MemoryMeasure. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
boolean
boolean
boolean
take()
Retrieves and removes the head of this queue, or returns null if this queue is empty.
-
Method Details
-
add
- Parameters:
e
-- Returns:
- true, if successful
-
add
- Parameters:
e
-autoDestroyOnFailedToAdd
-- Returns:
- true, if successful
-
add
- 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
- Parameters:
timeout
-unit
-- Returns:
- Throws:
InterruptedException
- the interrupted exception
-
contains
- Parameters:
e
-- Returns:
- boolean
-