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()
Deprecated.
This will be removed in next major release. Use
destroy() . |
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)
Deprecated.
This will be removed in next major release. Use
returnBrokenResource(java.lang.Object) . |
void |
returnResource(T resource) |
protected void |
returnResourceObject(T resource)
Deprecated.
This will be removed in next major release. Use
returnResource(java.lang.Object) . |
@Deprecated protected org.apache.commons.pool2.impl.GenericObjectPool<T> internalPool
@Deprecated public Pool()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public 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()
@Deprecated protected void returnResourceObject(T resource)
returnResource(java.lang.Object)
.resource
- public void returnBrokenResource(T resource)
public void returnResource(T resource)
public void destroy()
@Deprecated protected void returnBrokenResourceObject(T resource)
returnBrokenResource(java.lang.Object)
.resource
- @Deprecated protected void closeInternalPool()
destroy()
.public int getNumActive()
public int getNumIdle()
public int getNumWaiters()
public long getMeanBorrowWaitTimeMillis()
public long getMaxBorrowWaitTimeMillis()
public void addObjects(int count)
Copyright © 2022. All rights reserved.