Package org.jppf.utils.pooling
Interface ObjectPool<E>
- Type Parameters:
E- the type of objects in the pool.
- All Known Implementing Classes:
AbstractBoundedObjectPoolQueue,AbstractObjectPoolImpl,AbstractObjectPoolQueue,AbstractPoolSet,BoundedByteArrayPool,DirectBufferPoolQueue,SynchronizedDirectBufferPool
public interface ObjectPool<E>
Interface for oject pools.
- Author:
- Laurent Cohen
-
Method Summary
-
Method Details
-
get
E get()Get an object from the pool, or create it if the pool is empty.- Returns:
- a new Object of the type handled by this pool.
-
put
Release an object into this pool, and make it available.- Parameters:
content- the object to release.
-
isEmpty
boolean isEmpty()Determine whether this pool is empty.- Returns:
trueif the pool is empty,falseotherwise.
-
size
int size()Get the number of objects in this pool. This is an optional operation, as it may not always be done in constant time.- Returns:
- the size of this pool, or -1 if this operation is not supported.
-