R - the type of the resourcepublic 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.
| Constructor and Description |
|---|
PoolMap.ReusablePool(int maxSize) |
| Modifier and Type | Method and Description |
|---|---|
R |
get() |
R |
put(R resource) |
Collection<R> |
values() |
add, addAll, contains, isEmpty, iterator, offer, peek, poll, remove, size, toArray, toArrayclear, element, removecontainsAll, removeAll, retainAll, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclear, remove, sizeclear, containsAll, equals, hashCode, removeAll, retainAllpublic R get()
get in interface PoolMap.Pool<R>public R put(R resource)
put in interface PoolMap.Pool<R>public Collection<R> values()
values in interface PoolMap.Pool<R>Copyright © 2014 The Apache Software Foundation. All rights reserved.