public abstract class Pool<T> extends LinkedList<T> implements 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 |
modCount| 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() |
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, toArrayiteratorequals, hashCode, listIterator, removeRange, subListcontainsAll, isEmpty, removeAll, retainAll, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcontainsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subListparallelStream, removeIf, streamprotected 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 Closeableclose in interface AutoCloseablepublic String name()
public boolean isClosed()
public abstract T createObject() throws PoolException
PoolExceptionpublic void destroyObject(T object)
public final T borrowObject() throws PoolException, InterruptedException
PoolExceptionInterruptedExceptionpublic final void returnObject(T object)
public final void invalidateObject(T object)
public final void invalidateAll()
protected final void initialize()
Copyright © 2019. All rights reserved.