public class DefaultBlockingPool<T> extends Object implements BlockingPool<T>
| Constructor and Description | 
|---|
DefaultBlockingPool(com.google.common.base.Supplier<T> generator,
                   int limit)  | 
| Modifier and Type | Method and Description | 
|---|---|
int | 
getPoolSize()  | 
int | 
maxSize()  | 
ReferenceCountingResourceHolder<T> | 
take()
Take a resource from the pool, waiting if necessary until an element becomes available. 
 | 
ReferenceCountingResourceHolder<T> | 
take(long timeoutMs)
Take a resource from the pool, waiting up to the
 specified wait time if necessary for an element to become available. 
 | 
ReferenceCountingResourceHolder<List<T>> | 
takeBatch(int elementNum)
Take resources from the pool, waiting if necessary until the elements of the given number become available. 
 | 
ReferenceCountingResourceHolder<List<T>> | 
takeBatch(int elementNum,
         long timeoutMs)
Take resources from the pool, waiting up to the
 specified wait time if necessary for elements of the given number to become available. 
 | 
public DefaultBlockingPool(com.google.common.base.Supplier<T> generator, int limit)
public int maxSize()
maxSize in interface BlockingPool<T>public int getPoolSize()
public ReferenceCountingResourceHolder<T> take(long timeoutMs)
BlockingPooltake in interface BlockingPool<T>timeoutMs - maximum time to wait for a resource, in milliseconds.public ReferenceCountingResourceHolder<T> take()
BlockingPooltake in interface BlockingPool<T>public ReferenceCountingResourceHolder<List<T>> takeBatch(int elementNum, long timeoutMs)
BlockingPooltakeBatch in interface BlockingPool<T>elementNum - number of resources to taketimeoutMs - maximum time to wait for resources, in milliseconds.public ReferenceCountingResourceHolder<List<T>> takeBatch(int elementNum)
BlockingPooltakeBatch in interface BlockingPool<T>elementNum - number of resources to takeCopyright © 2011–2018. All rights reserved.