|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ObjectPool<E>
Interface modeling an object pool. The basic operations of an object pool include requesting objects from the pool as well as putting them back when they are not used any longer.
Method Summary | |
---|---|
int |
compact()
Compact the pool to avoid excessive memory consumption. |
E |
get()
Returns an object from the pool. |
void |
put(E obj)
Returns an object previously fetched from this pool to the pool. |
void |
putAll(java.util.Collection<? extends E> obj)
Returns a batch of objects previously fetched from the pool |
void |
reset()
Clears the internal state of the pool. |
Method Detail |
---|
E get() throws ObjectInstantiationException
ObjectInstantiationException
- if a new object could not be instantiatedvoid put(E obj)
obj
- Object to be returned to the pool.void putAll(java.util.Collection<? extends E> obj)
obj
- Object to be returned to the pool.void reset()
int compact()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |