Java org.apache.commons.pool2.impl GenericObjectPool fields, constructors, methods, implement or subclass

Example usage for Java org.apache.commons.pool2.impl GenericObjectPool fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.apache.commons.pool2.impl GenericObjectPool.

The text is from its open source code.

Subclass

org.apache.commons.pool2.impl.GenericObjectPool has subclasses.
Click this link to see all its subclasses.

Constructor

GenericObjectPool(PooledObjectFactory factory)
Create a new GenericObjectPool using defaults from GenericObjectPoolConfig .
GenericObjectPool(PooledObjectFactory factory, GenericObjectPoolConfig config)
Create a new GenericObjectPool using a specific configuration.
GenericObjectPool(PooledObjectFactory factory, GenericObjectPoolConfig config, AbandonedConfig abandonedConfig)
Create a new GenericObjectPool that tracks and destroys objects that are checked out, but never returned to the pool.

Method

voidaddObject()
Create an object, and place it into the pool.
TborrowObject()
Equivalent to #borrowObject(long) borrowObject ( #getMaxWaitMillis() ).
TborrowObject(long borrowMaxWaitMillis)
Borrow an object from the pool using the specific waiting time which only applies if #getBlockWhenExhausted() is true.
voidclear()
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.
voidclose()
Closes the pool.
PooledObjectFactorygetFactory()
Obtain a reference to the factory used to create, destroy and validate the objects used by this pool.
intgetMaxIdle()
Returns the cap on the number of "idle" instances in the pool.
intgetMinIdle()
Returns the target for the minimum number of idle objects to maintain in the pool.
intgetNumActive()
intgetNumIdle()
intgetNumWaiters()
Return an estimate of the number of threads currently blocked waiting for an object from the pool.
voidinvalidateObject(T obj)

Activation of this method decrements the active count and attempts to destroy the instance.

voidpreparePool()
Tries to ensure that #getMinIdle() idle instances are available in the pool.
voidreturnObject(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.

voidsetAbandonedConfig(AbandonedConfig abandonedConfig)
Sets the abandoned object removal configuration.
voidsetConfig(GenericObjectPoolConfig conf)
Sets the base pool configuration.
voidsetMaxIdle(int maxIdle)
Returns the cap on the number of "idle" instances in the pool.
voidsetMinIdle(int minIdle)
Sets the target for the minimum number of idle objects to maintain in the pool.