R - the type of the resourcepublic static class PoolMap.ReusablePool<R> extends ConcurrentLinkedQueue<R> implements PoolMap.Pool<R>
ReusablePool represents a PoolMap.Pool that builds
on the LinkedList class. It essentially allows resources to be
checked out, at which point it is removed from this pool. When the resource
is no longer required, it should be returned to the pool in order to be
reused.
If maxSize is set to Integer.MAX_VALUE, then the size of
the pool is unbounded. Otherwise, it caps the number of consumers that can
check out a resource from this pool to the (non-zero positive) value
specified in maxSize.
| 构造器和说明 |
|---|
ReusablePool(int maxSize) |
| 限定符和类型 | 方法和说明 |
|---|---|
R |
get() |
R |
put(R resource) |
Collection<R> |
values() |
add, addAll, contains, isEmpty, iterator, offer, peek, poll, remove, size, spliterator, toArray, toArrayclear, element, removecontainsAll, removeAll, retainAll, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclear, remove, sizeclear, containsAll, equals, hashCode, parallelStream, removeAll, removeIf, retainAll, streampublic R get()
get 在接口中 PoolMap.Pool<R>public R put(R resource)
put 在接口中 PoolMap.Pool<R>public Collection<R> values()
values 在接口中 PoolMap.Pool<R>Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.