T
- the type of objects held in this poolpublic class GenericObjectPoolFactory<T> extends Object implements ObjectPoolFactory<T>
GenericObjectPool
instances.GenericObjectPool
,
ObjectPoolFactory
Modifier and Type | Field and Description |
---|---|
protected PoolableObjectFactory<T> |
_factory
Deprecated.
to be removed in pool 2.0. Use
getFactory() . |
protected boolean |
_lifo
Deprecated.
to be removed in pool 2.0. Use
getLifo() . |
protected int |
_maxActive
Deprecated.
to be removed in pool 2.0. Use
getMaxActive() . |
protected int |
_maxIdle
Deprecated.
to be removed in pool 2.0. Use
getMaxIdle() . |
protected long |
_maxWait
Deprecated.
to be removed in pool 2.0. Use
getMaxWait() . |
protected long |
_minEvictableIdleTimeMillis
Deprecated.
to be removed in pool 2.0. Use
getMinEvictableIdleTimeMillis() . |
protected int |
_minIdle
Deprecated.
to be removed in pool 2.0. Use
getMinIdle() . |
protected int |
_numTestsPerEvictionRun
Deprecated.
to be removed in pool 2.0. Use
getNumTestsPerEvictionRun() . |
protected long |
_softMinEvictableIdleTimeMillis
Deprecated.
to be removed in pool 2.0. Use
getSoftMinEvictableIdleTimeMillis() . |
protected boolean |
_testOnBorrow
Deprecated.
to be removed in pool 2.0. Use
getTestOnBorrow() . |
protected boolean |
_testOnReturn
Deprecated.
to be removed in pool 2.0. Use
getTestOnReturn() . |
protected boolean |
_testWhileIdle
Deprecated.
to be removed in pool 2.0. Use
getTestWhileIdle() . |
protected long |
_timeBetweenEvictionRunsMillis
Deprecated.
to be removed in pool 2.0. Use
getTimeBetweenEvictionRunsMillis() . |
protected byte |
_whenExhaustedAction
Deprecated.
to be removed in pool 2.0. Use
getWhenExhaustedAction() . |
Constructor and Description |
---|
GenericObjectPoolFactory(PoolableObjectFactory<T> factory)
Create a new GenericObjectPoolFactory.
|
GenericObjectPoolFactory(PoolableObjectFactory<T> factory,
GenericObjectPool.Config config)
Create a new GenericObjectPoolFactory.
|
GenericObjectPoolFactory(PoolableObjectFactory<T> factory,
int maxActive)
Create a new GenericObjectPoolFactory.
|
GenericObjectPoolFactory(PoolableObjectFactory<T> factory,
int maxActive,
byte whenExhaustedAction,
long maxWait)
Create a new GenericObjectPoolFactory.
|
GenericObjectPoolFactory(PoolableObjectFactory<T> factory,
int maxActive,
byte whenExhaustedAction,
long maxWait,
boolean testOnBorrow,
boolean testOnReturn)
Create a new GenericObjectPoolFactory.
|
GenericObjectPoolFactory(PoolableObjectFactory<T> factory,
int maxActive,
byte whenExhaustedAction,
long maxWait,
int maxIdle)
Create a new GenericObjectPoolFactory.
|
GenericObjectPoolFactory(PoolableObjectFactory<T> factory,
int maxActive,
byte whenExhaustedAction,
long maxWait,
int maxIdle,
boolean testOnBorrow,
boolean testOnReturn)
Create a new GenericObjectPoolFactory.
|
GenericObjectPoolFactory(PoolableObjectFactory<T> factory,
int maxActive,
byte whenExhaustedAction,
long maxWait,
int maxIdle,
boolean testOnBorrow,
boolean testOnReturn,
long timeBetweenEvictionRunsMillis,
int numTestsPerEvictionRun,
long minEvictableIdleTimeMillis,
boolean testWhileIdle)
Create a new GenericObjectPoolFactory.
|
GenericObjectPoolFactory(PoolableObjectFactory<T> factory,
int maxActive,
byte whenExhaustedAction,
long maxWait,
int maxIdle,
int minIdle,
boolean testOnBorrow,
boolean testOnReturn,
long timeBetweenEvictionRunsMillis,
int numTestsPerEvictionRun,
long minEvictableIdleTimeMillis,
boolean testWhileIdle)
Create a new GenericObjectPoolFactory.
|
GenericObjectPoolFactory(PoolableObjectFactory<T> factory,
int maxActive,
byte whenExhaustedAction,
long maxWait,
int maxIdle,
int minIdle,
boolean testOnBorrow,
boolean testOnReturn,
long timeBetweenEvictionRunsMillis,
int numTestsPerEvictionRun,
long minEvictableIdleTimeMillis,
boolean testWhileIdle,
long softMinEvictableIdleTimeMillis)
Create a new GenericObjectPoolFactory.
|
GenericObjectPoolFactory(PoolableObjectFactory<T> factory,
int maxActive,
byte whenExhaustedAction,
long maxWait,
int maxIdle,
int minIdle,
boolean testOnBorrow,
boolean testOnReturn,
long timeBetweenEvictionRunsMillis,
int numTestsPerEvictionRun,
long minEvictableIdleTimeMillis,
boolean testWhileIdle,
long softMinEvictableIdleTimeMillis,
boolean lifo)
Create a new GenericObjectPoolFactory.
|
Modifier and Type | Method and Description |
---|---|
ObjectPool<T> |
createPool()
Create and return a new
ObjectPool . |
PoolableObjectFactory<T> |
getFactory() |
boolean |
getLifo() |
int |
getMaxActive() |
int |
getMaxIdle() |
long |
getMaxWait() |
long |
getMinEvictableIdleTimeMillis() |
int |
getMinIdle() |
int |
getNumTestsPerEvictionRun() |
long |
getSoftMinEvictableIdleTimeMillis() |
boolean |
getTestOnBorrow() |
boolean |
getTestOnReturn() |
boolean |
getTestWhileIdle() |
long |
getTimeBetweenEvictionRunsMillis() |
byte |
getWhenExhaustedAction() |
@Deprecated protected int _maxIdle
getMaxIdle()
.maxIdle
setting for pools created by this factory.@Deprecated protected int _minIdle
getMinIdle()
.minIdle
setting for pools created by this factory.@Deprecated protected int _maxActive
getMaxActive()
.maxActive
setting for pools created by this factory.@Deprecated protected long _maxWait
getMaxWait()
.maxWait
setting for pools created by this factory.@Deprecated protected byte _whenExhaustedAction
getWhenExhaustedAction()
.whenExhaustedAction
setting for pools
created by this factory.@Deprecated protected boolean _testOnBorrow
getTestOnBorrow()
.testOnBorrow
setting for pools created by this factory.@Deprecated protected boolean _testOnReturn
getTestOnReturn()
.testOnReturn
setting for pools created by this factory.@Deprecated protected boolean _testWhileIdle
getTestWhileIdle()
.testWhileIdle
setting for pools created by this factory.@Deprecated protected long _timeBetweenEvictionRunsMillis
getTimeBetweenEvictionRunsMillis()
.timeBetweenEvictionRunsMillis
setting for pools created by this factory.@Deprecated protected int _numTestsPerEvictionRun
getNumTestsPerEvictionRun()
.numTestsPerEvictionRun
setting
for pools created by this factory.@Deprecated protected long _minEvictableIdleTimeMillis
getMinEvictableIdleTimeMillis()
.minEvictableIdleTimeMillis
setting for pools created by this factory.@Deprecated protected long _softMinEvictableIdleTimeMillis
getSoftMinEvictableIdleTimeMillis()
.softMinEvictableIdleTimeMillis
setting for pools created by this factory.@Deprecated protected boolean _lifo
getLifo()
.lifo
setting for pools created by this factory.@Deprecated protected PoolableObjectFactory<T> _factory
getFactory()
.PoolableObjectFactory
used by pools created by this factory.public GenericObjectPoolFactory(PoolableObjectFactory<T> factory)
factory
- the PoolableObjectFactory used by created pools.GenericObjectPool.GenericObjectPool(PoolableObjectFactory)
public GenericObjectPoolFactory(PoolableObjectFactory<T> factory, GenericObjectPool.Config config) throws NullPointerException
factory
- the PoolableObjectFactory used by created pools.config
- a non-null
GenericObjectPool.Config describing the configuration.NullPointerException
- when config is null
.GenericObjectPool.GenericObjectPool(PoolableObjectFactory, GenericObjectPool.Config)
public GenericObjectPoolFactory(PoolableObjectFactory<T> factory, int maxActive)
factory
- the PoolableObjectFactory used by created pools.maxActive
- maximum number of objects that can be borrowed from created pools at one time.GenericObjectPool.GenericObjectPool(PoolableObjectFactory, int)
public GenericObjectPoolFactory(PoolableObjectFactory<T> factory, int maxActive, byte whenExhaustedAction, long maxWait)
factory
- the PoolableObjectFactory used by created pools.maxActive
- maximum number of objects that can be borrowed from created pools at one time.whenExhaustedAction
- the action to take when the pool is exhausted.maxWait
- the maximum amount of time to wait for an idle object when the pool is exhausted.GenericObjectPool.GenericObjectPool(PoolableObjectFactory, int, byte, long)
public GenericObjectPoolFactory(PoolableObjectFactory<T> factory, int maxActive, byte whenExhaustedAction, long maxWait, boolean testOnBorrow, boolean testOnReturn)
factory
- the PoolableObjectFactory used by created pools.maxActive
- maximum number of objects that can be borrowed from created pools at one time.whenExhaustedAction
- the action to take when the pool is exhausted.maxWait
- the maximum amount of time to wait for an idle object when the pool is exhausted.testOnBorrow
- whether to validate objects before they are returned by the borrowObject.testOnReturn
- whether to validate objects after they are returned to the returnObject.GenericObjectPool.GenericObjectPool(PoolableObjectFactory, int, byte, long, boolean, boolean)
public GenericObjectPoolFactory(PoolableObjectFactory<T> factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle)
factory
- the PoolableObjectFactory used by created pools.maxActive
- maximum number of objects that can be borrowed from created pools at one time.whenExhaustedAction
- the action to take when the pool is exhausted.maxWait
- the maximum amount of time to wait for an idle object when the pool is exhausted.maxIdle
- the maximum number of idle objects in my pool.GenericObjectPool.GenericObjectPool(PoolableObjectFactory, int, byte, long, int)
public GenericObjectPoolFactory(PoolableObjectFactory<T> factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle, boolean testOnBorrow, boolean testOnReturn)
factory
- the PoolableObjectFactory used by created pools.maxActive
- maximum number of objects that can be borrowed from created pools at one time.whenExhaustedAction
- the action to take when the pool is exhausted.maxWait
- the maximum amount of time to wait for an idle object when the pool is exhausted.maxIdle
- the maximum number of idle objects in my pool.testOnBorrow
- whether to validate objects before they are returned by the borrowObject.testOnReturn
- whether to validate objects after they are returned to the returnObject.GenericObjectPool.GenericObjectPool(PoolableObjectFactory, int, byte, long, int, boolean, boolean)
public GenericObjectPoolFactory(PoolableObjectFactory<T> factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle)
factory
- the PoolableObjectFactory used by created pools.maxActive
- maximum number of objects that can be borrowed from created pools at one time.whenExhaustedAction
- the action to take when the pool is exhausted.maxWait
- the maximum amount of time to wait for an idle object when the pool is exhausted.maxIdle
- the maximum number of idle objects in my pool.testOnBorrow
- whether to validate objects before they are returned by the borrowObject.testOnReturn
- whether to validate objects after they are returned to the returnObject.timeBetweenEvictionRunsMillis
- the number of milliseconds to sleep between examining idle objects for eviction.numTestsPerEvictionRun
- the number of idle objects to examine per run within the idle object eviction thread.minEvictableIdleTimeMillis
- the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction.testWhileIdle
- whether or not to validate objects in the idle object eviction thread.GenericObjectPool.GenericObjectPool(PoolableObjectFactory, int, byte, long, int, boolean, boolean, long, int, long, boolean)
public GenericObjectPoolFactory(PoolableObjectFactory<T> factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle, int minIdle, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle)
factory
- the PoolableObjectFactory used by created pools.maxActive
- maximum number of objects that can be borrowed from created pools at one time.whenExhaustedAction
- the action to take when the pool is exhausted.maxWait
- the maximum amount of time to wait for an idle object when the pool is exhausted.maxIdle
- the maximum number of idle objects in my pool.minIdle
- the minimum number of idle objects in my pool.testOnBorrow
- whether to validate objects before they are returned by the borrowObject.testOnReturn
- whether to validate objects after they are returned to the returnObject.timeBetweenEvictionRunsMillis
- the number of milliseconds to sleep between examining idle objects for eviction.numTestsPerEvictionRun
- the number of idle objects to examine per run within the idle object eviction thread.minEvictableIdleTimeMillis
- the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction.testWhileIdle
- whether or not to validate objects in the idle object eviction thread.GenericObjectPool.GenericObjectPool(PoolableObjectFactory, int, byte, long, int, int, boolean, boolean, long, int, long, boolean)
public GenericObjectPoolFactory(PoolableObjectFactory<T> factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle, int minIdle, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle, long softMinEvictableIdleTimeMillis)
factory
- the PoolableObjectFactory used by created pools.maxActive
- maximum number of objects that can be borrowed from created pools at one time.whenExhaustedAction
- the action to take when the pool is exhausted.maxWait
- the maximum amount of time to wait for an idle object when the pool is exhausted.maxIdle
- the maximum number of idle objects in my pool.minIdle
- the minimum number of idle objects in my pool.testOnBorrow
- whether to validate objects before they are returned by the borrowObject.testOnReturn
- whether to validate objects after they are returned to the returnObject.timeBetweenEvictionRunsMillis
- the number of milliseconds to sleep between examining idle objects for eviction.numTestsPerEvictionRun
- the number of idle objects to examine per run within the idle object eviction thread.minEvictableIdleTimeMillis
- the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction.testWhileIdle
- whether or not to validate objects in the idle object eviction thread.softMinEvictableIdleTimeMillis
- the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction with the extra condition that at least "minIdle" amount of object remain in the pool.GenericObjectPool.GenericObjectPool(PoolableObjectFactory, int, byte, long, int, int, boolean, boolean, long, int, long, boolean, long)
public GenericObjectPoolFactory(PoolableObjectFactory<T> factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle, int minIdle, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle, long softMinEvictableIdleTimeMillis, boolean lifo)
factory
- the PoolableObjectFactory used by created pools.maxActive
- maximum number of objects that can be borrowed from created pools at one time.whenExhaustedAction
- the action to take when the pool is exhausted.maxWait
- the maximum amount of time to wait for an idle object when the pool is exhausted.maxIdle
- the maximum number of idle objects in my pool.minIdle
- the minimum number of idle objects in my pool.testOnBorrow
- whether to validate objects before they are returned by the borrowObject.testOnReturn
- whether to validate objects after they are returned to the returnObject.timeBetweenEvictionRunsMillis
- the number of milliseconds to sleep between examining idle objects for eviction.numTestsPerEvictionRun
- the number of idle objects to examine per run within the idle object eviction thread.minEvictableIdleTimeMillis
- the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction.testWhileIdle
- whether or not to validate objects in the idle object eviction thread.softMinEvictableIdleTimeMillis
- the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction with the extra condition that at least "minIdle" amount of object remain in the pool.lifo
- whether or not objects are returned in last-in-first-out order from the idle object pool.GenericObjectPool.GenericObjectPool(PoolableObjectFactory, int, byte, long, int, int, boolean, boolean, long, int, long, boolean, long, boolean)
public ObjectPool<T> createPool()
ObjectPool
.createPool
in interface ObjectPoolFactory<T>
ObjectPool
public int getMaxIdle()
maxIdle
setting for pools created by this factory.public int getMinIdle()
minIdle
setting for pools created by this factory.public int getMaxActive()
maxActive
setting for pools created by this factory.public long getMaxWait()
maxWait
setting for pools created by this factory.public byte getWhenExhaustedAction()
whenExhaustedAction
setting for pools
created by this factory.public boolean getTestOnBorrow()
testOnBorrow
setting for pools
created by this factory.public boolean getTestOnReturn()
testOnReturn
setting for pools
created by this factory.public boolean getTestWhileIdle()
testWhileIdle
setting for pools
created by this factory.public long getTimeBetweenEvictionRunsMillis()
timeBetweenEvictionRunsMillis
setting for pools created by this factory.public int getNumTestsPerEvictionRun()
numTestsPerEvictionRun
setting for pools created by this factory.public long getMinEvictableIdleTimeMillis()
minEvictableIdleTimeMillis
setting for pools created by this factory.public long getSoftMinEvictableIdleTimeMillis()
softMinEvicatableIdleTimeMillis
setting for pools created by this factory.public boolean getLifo()
lifo
setting for pools created by this factory.public PoolableObjectFactory<T> getFactory()
PoolableObjectFactory
used by pools created by this factoryCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.