public abstract class Pool<T>
extends java.lang.Object
implements java.io.Closeable
构造器和说明 |
---|
Pool()
已过时。
This constructor will be removed in future.
|
Pool(GenericObjectPoolConfig<T> poolConfig,
PooledObjectFactory<T> factory) |
限定符和类型 | 方法和说明 |
---|---|
void |
addObjects(int count) |
void |
close() |
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(GenericObjectPoolConfig<T> poolConfig,
PooledObjectFactory<T> factory)
已过时。
This method will be private in future.
|
boolean |
isClosed() |
void |
returnBrokenResource(T resource) |
void |
returnResource(T resource) |
@Deprecated public Pool()
public Pool(GenericObjectPoolConfig<T> poolConfig, PooledObjectFactory<T> factory)
public void close()
close
在接口中 java.io.Closeable
close
在接口中 java.lang.AutoCloseable
public boolean isClosed()
@Deprecated public void initPool(GenericObjectPoolConfig<T> poolConfig, PooledObjectFactory<T> factory)
poolConfig
- factory
- public T getResource()
public void returnBrokenResource(T resource)
public void returnResource(T resource)
public void destroy()
public int getNumActive()
public int getNumIdle()
public int getNumWaiters()
public long getMeanBorrowWaitTimeMillis()
public long getMaxBorrowWaitTimeMillis()
public void addObjects(int count)