public abstract class Pool<T>
extends java.util.LinkedList<T>
implements java.io.Closeable
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closed |
protected int |
createdCount |
protected boolean |
fifo |
protected int |
initialCount |
protected boolean |
keepEmpty |
protected int |
maxCount |
protected int |
timeout |
protected int |
timeouts |
protected int |
waitingThreads |
| Modifier | Constructor and Description |
|---|---|
protected |
Pool(int initialCount,
int maxCount,
int timeout) |
| Modifier and Type | Method and Description |
|---|---|
T |
borrowObject() |
void |
close() |
abstract T |
createObject() |
void |
destroyObject(T object) |
protected void |
initialize() |
void |
invalidateAll() |
void |
invalidateObject(T object) |
boolean |
isClosed() |
java.lang.String |
name() |
void |
returnObject(T object) |
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArrayequals, hashCode, listIterator, removeRange, subListcontainsAll, isEmpty, removeAll, retainAll, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitprotected boolean closed
protected boolean keepEmpty
protected boolean fifo
protected int initialCount
protected int createdCount
protected int maxCount
protected int timeout
protected int timeouts
protected int waitingThreads
public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic java.lang.String name()
public boolean isClosed()
public abstract T createObject() throws PoolException
PoolExceptionpublic void destroyObject(T object)
public final T borrowObject() throws PoolException, java.lang.InterruptedException
PoolExceptionjava.lang.InterruptedExceptionpublic final void returnObject(T object)
public final void invalidateObject(T object)
public final void invalidateAll()
protected final void initialize()