public abstract class Pool<T> extends Object implements Closeable
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.pool2.impl.GenericObjectPool<T> |
internalPool
Deprecated.
This will be private in future.
|
| Constructor and Description |
|---|
Pool()
Deprecated.
This constructor will be removed in future.
|
Pool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<T> poolConfig,
org.apache.commons.pool2.PooledObjectFactory<T> factory) |
| Modifier and Type | Method and Description |
|---|---|
void |
addObjects(int count) |
protected void |
clearInternalPool()
This call only clears idle instances, not borrowed instances.
|
void |
close() |
protected void |
closeInternalPool() |
void |
destroy() |
long |
getMaxBorrowWaitTimeMillis()
Returns the maximum waiting time spent by threads to obtain a resource
from this pool.
|
long |
getMeanBorrowWaitTimeMillis()
Returns the mean waiting time spent by threads to obtain a resource from
this pool.
|
int |
getNumActive()
Returns the number of instances currently borrowed from this pool.
|
int |
getNumIdle()
Returns the number of instances currently idle in this pool.
|
int |
getNumWaiters()
Returns an estimate of the number of threads currently blocked waiting for
a resource from this pool.
|
T |
getResource() |
void |
initPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<T> poolConfig,
org.apache.commons.pool2.PooledObjectFactory<T> factory)
Deprecated.
This method will be private in future.
|
boolean |
isClosed() |
void |
returnBrokenResource(T resource) |
protected void |
returnBrokenResourceObject(T resource) |
void |
returnResource(T resource) |
protected void |
returnResourceObject(T resource) |
@Deprecated protected org.apache.commons.pool2.impl.GenericObjectPool<T> internalPool
@Deprecated public Pool()
public void close()
close in interface Closeableclose in interface AutoCloseablepublic boolean isClosed()
@Deprecated public void initPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<T> poolConfig, org.apache.commons.pool2.PooledObjectFactory<T> factory)
poolConfig - factory - protected void clearInternalPool()
public T getResource()
protected void returnResourceObject(T resource)
public void returnBrokenResource(T resource)
public void returnResource(T resource)
public void destroy()
protected void returnBrokenResourceObject(T resource)
protected void closeInternalPool()
public int getNumActive()
public int getNumIdle()
public int getNumWaiters()
public long getMeanBorrowWaitTimeMillis()
public long getMaxBorrowWaitTimeMillis()
public void addObjects(int count)
Copyright © 2021. All rights reserved.