Package one.nio.pool
Class Pool<T>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.AbstractSequentialList<E>
java.util.LinkedList<T>
one.nio.pool.Pool<T>
- All Implemented Interfaces:
Closeable,Serializable,AutoCloseable,Cloneable,Iterable<T>,Collection<T>,Deque<T>,List<T>,Queue<T>
- Direct Known Subclasses:
SocketPool
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected intprotected booleanprotected intprotected booleanprotected intprotected intprotected intprotected intFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Tvoidclose()abstract TvoiddestroyObject(T object) protected final voidfinal voidfinal voidinvalidateObject(T object) booleanisClosed()name()final voidreturnObject(T object) Methods inherited from class java.util.LinkedList
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, toArrayMethods inherited from class java.util.AbstractSequentialList
iteratorMethods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
-
Field Details
-
closed
protected boolean closed -
keepEmpty
protected boolean keepEmpty -
fifo
protected boolean fifo -
initialCount
protected int initialCount -
createdCount
protected int createdCount -
maxCount
protected int maxCount -
timeout
protected int timeout -
timeouts
protected int timeouts -
waitingThreads
protected int waitingThreads
-
-
Constructor Details
-
Pool
protected Pool(int initialCount, int maxCount, int timeout)
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
name
-
isClosed
public boolean isClosed() -
createObject
- Throws:
PoolException
-
destroyObject
-
borrowObject
- Throws:
PoolExceptionInterruptedException
-
returnObject
-
invalidateObject
-
invalidateAll
public final void invalidateAll() -
initialize
protected final void initialize()
-