K
- the type of keys in this poolV
- the type of objects held in this poolpublic class GenericKeyedObjectPoolFactory<K,V> extends Object implements KeyedObjectPoolFactory<K,V>
GenericKeyedObjectPool
instances.GenericKeyedObjectPool
,
KeyedObjectPoolFactory
Modifier and Type | Field and Description |
---|---|
protected KeyedPoolableObjectFactory<K,V> |
_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 int |
_maxTotal
Deprecated.
to be removed in pool 2.0. Use
getMaxTotal() . |
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 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 |
---|
GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory)
Create a new GenericKeyedObjectPoolFactory.
|
GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory,
GenericKeyedObjectPool.Config config)
Create a new GenericKeyedObjectPoolFactory.
|
GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory,
int maxActive)
Create a new GenericKeyedObjectPoolFactory.
|
GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory,
int maxActive,
byte whenExhaustedAction,
long maxWait)
Create a new GenericKeyedObjectPoolFactory.
|
GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory,
int maxActive,
byte whenExhaustedAction,
long maxWait,
boolean testOnBorrow,
boolean testOnReturn)
Create a new GenericKeyedObjectPoolFactory.
|
GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory,
int maxActive,
byte whenExhaustedAction,
long maxWait,
int maxIdle)
Create a new GenericKeyedObjectPoolFactory.
|
GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory,
int maxActive,
byte whenExhaustedAction,
long maxWait,
int maxIdle,
boolean testOnBorrow,
boolean testOnReturn)
Create a new GenericKeyedObjectPoolFactory.
|
GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory,
int maxActive,
byte whenExhaustedAction,
long maxWait,
int maxIdle,
boolean testOnBorrow,
boolean testOnReturn,
long timeBetweenEvictionRunsMillis,
int numTestsPerEvictionRun,
long minEvictableIdleTimeMillis,
boolean testWhileIdle)
Create a new GenericKeyedObjectPoolFactory.
|
GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory,
int maxActive,
byte whenExhaustedAction,
long maxWait,
int maxIdle,
int maxTotal)
Create a new GenericKeyedObjectPoolFactory.
|
GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory,
int maxActive,
byte whenExhaustedAction,
long maxWait,
int maxIdle,
int maxTotal,
boolean testOnBorrow,
boolean testOnReturn,
long timeBetweenEvictionRunsMillis,
int numTestsPerEvictionRun,
long minEvictableIdleTimeMillis,
boolean testWhileIdle)
Create a new GenericKeyedObjectPoolFactory.
|
GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory,
int maxActive,
byte whenExhaustedAction,
long maxWait,
int maxIdle,
int maxTotal,
int minIdle,
boolean testOnBorrow,
boolean testOnReturn,
long timeBetweenEvictionRunsMillis,
int numTestsPerEvictionRun,
long minEvictableIdleTimeMillis,
boolean testWhileIdle)
Create a new GenericKeyedObjectPoolFactory.
|
GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory,
int maxActive,
byte whenExhaustedAction,
long maxWait,
int maxIdle,
int maxTotal,
int minIdle,
boolean testOnBorrow,
boolean testOnReturn,
long timeBetweenEvictionRunsMillis,
int numTestsPerEvictionRun,
long minEvictableIdleTimeMillis,
boolean testWhileIdle,
boolean lifo)
Create a new GenericKeyedObjectPoolFactory.
|
Modifier and Type | Method and Description |
---|---|
KeyedObjectPool<K,V> |
createPool()
Create a new GenericKeyedObjectPool with the currently configured properties.
|
KeyedPoolableObjectFactory<K,V> |
getFactory() |
boolean |
getLifo() |
int |
getMaxActive() |
int |
getMaxIdle() |
int |
getMaxTotal() |
long |
getMaxWait() |
long |
getMinEvictableIdleTimeMillis() |
int |
getMinIdle() |
int |
getNumTestsPerEvictionRun() |
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 _maxActive
getMaxActive()
.maxActive
setting for pools created by this factory.@Deprecated protected int _maxTotal
getMaxTotal()
.maxTotal
setting for pools created by this factory.@Deprecated protected int _minIdle
getMinIdle()
.minIdle
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 KeyedPoolableObjectFactory<K,V> _factory
getFactory()
.KeyedPoolableObjectFactory
used by pools created by this factory.@Deprecated protected boolean _lifo
getLifo()
.lifo
setting for pools created by this factory.public GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory)
factory
- the KeyedPoolableObjectFactory to used by created pools.GenericKeyedObjectPool.GenericKeyedObjectPool(KeyedPoolableObjectFactory)
public GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory, GenericKeyedObjectPool.Config config) throws NullPointerException
factory
- the KeyedPoolableObjectFactory to used by created pools.config
- a non-null GenericKeyedObjectPool.Config describing the configuration.NullPointerException
- when config is null
.GenericKeyedObjectPool.GenericKeyedObjectPool(KeyedPoolableObjectFactory, GenericKeyedObjectPool.Config)
public GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory, int maxActive)
factory
- the KeyedPoolableObjectFactory to used by created pools.maxActive
- the maximum number of objects that can be borrowed from pools at one time.GenericKeyedObjectPool.GenericKeyedObjectPool(KeyedPoolableObjectFactory, int)
public GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory, int maxActive, byte whenExhaustedAction, long maxWait)
factory
- the KeyedPoolableObjectFactory to used by created pools.maxActive
- the maximum number of objects that can be borrowed from 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.GenericKeyedObjectPool.GenericKeyedObjectPool(KeyedPoolableObjectFactory, int, byte, long)
public GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory, int maxActive, byte whenExhaustedAction, long maxWait, boolean testOnBorrow, boolean testOnReturn)
factory
- the KeyedPoolableObjectFactory to used by created pools.maxActive
- the maximum number of objects that can be borrowed from 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 borrowObject.testOnReturn
- whether to validate objects after they are returned to returnObject.GenericKeyedObjectPool.GenericKeyedObjectPool(KeyedPoolableObjectFactory, int, byte, long, boolean, boolean)
public GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle)
factory
- the KeyedPoolableObjectFactory to used by created pools.maxActive
- the maximum number of objects that can be borrowed from 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 the pools.GenericKeyedObjectPool.GenericKeyedObjectPool(KeyedPoolableObjectFactory, int, byte, long, int)
public GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle, int maxTotal)
factory
- the KeyedPoolableObjectFactory to used by created pools.maxActive
- the maximum number of objects that can be borrowed from 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 the pools.maxTotal
- the maximum number of objects that can exists at one time.public GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle, boolean testOnBorrow, boolean testOnReturn)
factory
- the KeyedPoolableObjectFactory to used by created pools.maxActive
- the maximum number of objects that can be borrowed from 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 the pools.testOnBorrow
- whether to validate objects before they are returned by borrowObject.testOnReturn
- whether to validate objects after they are returned to returnObject.GenericKeyedObjectPool.GenericKeyedObjectPool(KeyedPoolableObjectFactory, int, byte, long, int, boolean, boolean)
public GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle)
factory
- the KeyedPoolableObjectFactory to used by created pools.maxActive
- the maximum number of objects that can be borrowed from 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 the pools.testOnBorrow
- whether to validate objects before they are returned by borrowObject.testOnReturn
- whether to validate objects after they are returned to returnObject.timeBetweenEvictionRunsMillis
- the number of milliseconds to sleep between examining idle objects for eviction.numTestsPerEvictionRun
- the number of idle objects to examine per run of the evictor.minEvictableIdleTimeMillis
- the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction.testWhileIdle
- whether to validate objects in the idle object eviction thread.GenericKeyedObjectPool.GenericKeyedObjectPool(KeyedPoolableObjectFactory, int, byte, long, int, boolean, boolean, long, int, long, boolean)
public GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle, int maxTotal, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle)
factory
- the KeyedPoolableObjectFactory to used by created pools.maxActive
- the maximum number of objects that can be borrowed from 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 the pools.maxTotal
- the maximum number of objects that can exists at one time.testOnBorrow
- whether to validate objects before they are returned by borrowObject.testOnReturn
- whether to validate objects after they are returned to returnObject.timeBetweenEvictionRunsMillis
- the number of milliseconds to sleep between examining idle objects for eviction.numTestsPerEvictionRun
- the number of idle objects to examine per run of the evictor.minEvictableIdleTimeMillis
- the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction.testWhileIdle
- whether to validate objects in the idle object eviction thread.GenericKeyedObjectPool.GenericKeyedObjectPool(KeyedPoolableObjectFactory, int, byte, long, int, int, boolean, boolean, long, int, long, boolean)
public GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle, int maxTotal, int minIdle, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle)
factory
- the KeyedPoolableObjectFactory to used by created pools.maxActive
- the maximum number of objects that can be borrowed from 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 the pools.maxTotal
- the maximum number of objects that can exists at one time.minIdle
- the minimum number of idle objects to have in the pool at any one time.testOnBorrow
- whether to validate objects before they are returned by borrowObject.testOnReturn
- whether to validate objects after they are returned to returnObject.timeBetweenEvictionRunsMillis
- the number of milliseconds to sleep between examining idle objects for eviction.numTestsPerEvictionRun
- the number of idle objects to examine per run of the evictor.minEvictableIdleTimeMillis
- the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction.testWhileIdle
- whether to validate objects in the idle object eviction thread.GenericKeyedObjectPool.GenericKeyedObjectPool(KeyedPoolableObjectFactory, int, byte, long, int, int, int, boolean, boolean, long, int, long, boolean)
public GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory<K,V> factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle, int maxTotal, int minIdle, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle, boolean lifo)
factory
- the KeyedPoolableObjectFactory to used by created pools.maxActive
- the maximum number of objects that can be borrowed from 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 the pools.maxTotal
- the maximum number of objects that can exists at one time.minIdle
- the minimum number of idle objects to have in the pool at any one time.testOnBorrow
- whether to validate objects before they are returned by borrowObject.testOnReturn
- whether to validate objects after they are returned to returnObject.timeBetweenEvictionRunsMillis
- the number of milliseconds to sleep between examining idle objects for eviction.numTestsPerEvictionRun
- the number of idle objects to examine per run of the evictor.minEvictableIdleTimeMillis
- the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction.testWhileIdle
- whether to validate objects in the idle object eviction thread.lifo
- whether or not objects are returned in last-in-first-out order from the idle object pool.GenericKeyedObjectPool.GenericKeyedObjectPool(KeyedPoolableObjectFactory, int, byte, long, int, int, int, boolean, boolean, long, int, long, boolean, boolean)
public KeyedObjectPool<K,V> createPool()
createPool
in interface KeyedObjectPoolFactory<K,V>
Configuration
determined by
current property settingspublic int getMaxIdle()
maxIdle
setting for pools created by this factory.public int getMaxActive()
maxActive
setting for pools created by this factory.public int getMaxTotal()
maxTotal
setting for pools created by this factory.public int getMinIdle()
minIdle
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 KeyedPoolableObjectFactory<K,V> getFactory()
KeyedPoolableObjectFactory
used by pools created by this factory.public boolean getLifo()
lifo
setting for pools created by this factory.Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.