Example usage for Java org.apache.commons.pool2.impl GenericObjectPool fields, constructors, methods, implement or subclass
The text is from its open source code.
GenericObjectPool(PooledObjectFactory Create a new GenericObjectPool using defaults from GenericObjectPoolConfig . | |
GenericObjectPool(PooledObjectFactory Create a new GenericObjectPool using a specific configuration. | |
GenericObjectPool(PooledObjectFactory Create a new GenericObjectPool that tracks and destroys objects that are checked out, but never returned to the pool. |
void | addObject() Create an object, and place it into the pool. |
T | borrowObject() Equivalent to #borrowObject(long) borrowObject ( #getMaxWaitMillis() ) . |
T | borrowObject(long borrowMaxWaitMillis) Borrow an object from the pool using the specific waiting time which only applies if #getBlockWhenExhausted() is true. |
void | clear() Clears any objects sitting idle in the pool by removing them from the idle instance pool and then invoking the configured PooledObjectFactory#destroyObject(PooledObject) method on each idle instance. |
void | close() Closes the pool. |
PooledObjectFactory | getFactory() Obtain a reference to the factory used to create, destroy and validate the objects used by this pool. |
int | getMaxIdle() Returns the cap on the number of "idle" instances in the pool. |
int | getMinIdle() Returns the target for the minimum number of idle objects to maintain in the pool. |
int | getNumActive() |
int | getNumIdle() |
int | getNumWaiters() Return an estimate of the number of threads currently blocked waiting for an object from the pool. |
void | invalidateObject(T obj) Activation of this method decrements the active count and attempts to destroy the instance. |
void | preparePool() Tries to ensure that #getMinIdle() idle instances are available in the pool. |
void | returnObject(T obj) If #getMaxIdle() maxIdle is set to a positive value and the number of idle instances has reached this value, the returning instance is destroyed. |
void | setAbandonedConfig(AbandonedConfig abandonedConfig) Sets the abandoned object removal configuration. |
void | setConfig(GenericObjectPoolConfig conf) Sets the base pool configuration. |
void | setMaxIdle(int maxIdle) Returns the cap on the number of "idle" instances in the pool. |
void | setMinIdle(int minIdle) Sets the target for the minimum number of idle objects to maintain in the pool. |