T
- Type of element pooled.public abstract class BaseObjectPoolConfig<T> extends BaseObject implements java.lang.Cloneable
This class is not thread-safe.
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_BLOCK_WHEN_EXHAUSTED
The default value for the
blockWhenExhausted configuration
attribute. |
static java.lang.String |
DEFAULT_EVICTION_POLICY_CLASS_NAME
The default value for the
evictionPolicyClassName configuration
attribute. |
static long |
DEFAULT_EVICTOR_SHUTDOWN_TIMEOUT_MILLIS
The default value for
evictorShutdownTimeoutMillis configuration
attribute. |
static boolean |
DEFAULT_FAIRNESS
The default value for the
fairness configuration attribute. |
static boolean |
DEFAULT_JMX_ENABLE
The default value for enabling JMX for pools created with a configuration
instance.
|
static java.lang.String |
DEFAULT_JMX_NAME_BASE
The default value for the base name to use to name JMX enabled pools
created with a configuration instance.
|
static java.lang.String |
DEFAULT_JMX_NAME_PREFIX
The default value for the prefix used to name JMX enabled pools created
with a configuration instance.
|
static boolean |
DEFAULT_LIFO
The default value for the
lifo configuration attribute. |
static long |
DEFAULT_MAX_WAIT_MILLIS
The default value for the
maxWait configuration attribute. |
static long |
DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS
The default value for the
minEvictableIdleTimeMillis
configuration attribute. |
static int |
DEFAULT_NUM_TESTS_PER_EVICTION_RUN
The default value for the
numTestsPerEvictionRun configuration
attribute. |
static long |
DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS
The default value for the
softMinEvictableIdleTimeMillis
configuration attribute. |
static boolean |
DEFAULT_TEST_ON_BORROW
The default value for the
testOnBorrow configuration attribute. |
static boolean |
DEFAULT_TEST_ON_CREATE
The default value for the
testOnCreate configuration attribute. |
static boolean |
DEFAULT_TEST_ON_RETURN
The default value for the
testOnReturn configuration attribute. |
static boolean |
DEFAULT_TEST_WHILE_IDLE
The default value for the
testWhileIdle configuration attribute. |
static long |
DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS
The default value for the
timeBetweenEvictionRunsMillis
configuration attribute. |
Constructor and Description |
---|
BaseObjectPoolConfig() |
Modifier and Type | Method and Description |
---|---|
boolean |
getBlockWhenExhausted()
Get the value for the
blockWhenExhausted configuration attribute
for pools created with this configuration instance. |
EvictionPolicy<T> |
getEvictionPolicy()
Get the value for the
evictionPolicyClass configuration
attribute for pools created with this configuration instance. |
java.lang.String |
getEvictionPolicyClassName()
Get the value for the
evictionPolicyClassName configuration
attribute for pools created with this configuration instance. |
long |
getEvictorShutdownTimeoutMillis()
Get the value for the
evictorShutdownTimeoutMillis configuration
attribute for pools created with this configuration instance. |
boolean |
getFairness()
Get the value for the
fairness configuration attribute for pools
created with this configuration instance. |
boolean |
getJmxEnabled()
Gets the value of the flag that determines if JMX will be enabled for
pools created with this configuration instance.
|
java.lang.String |
getJmxNameBase()
Gets the value of the JMX name base that will be used as part of the
name assigned to JMX enabled pools created with this configuration
instance.
|
java.lang.String |
getJmxNamePrefix()
Gets the value of the JMX name prefix that will be used as part of the
name assigned to JMX enabled pools created with this configuration
instance.
|
boolean |
getLifo()
Get the value for the
lifo configuration attribute for pools
created with this configuration instance. |
long |
getMaxWaitMillis()
Get the value for the
maxWait configuration attribute for pools
created with this configuration instance. |
long |
getMinEvictableIdleTimeMillis()
Get the value for the
minEvictableIdleTimeMillis configuration
attribute for pools created with this configuration instance. |
int |
getNumTestsPerEvictionRun()
Get the value for the
numTestsPerEvictionRun configuration
attribute for pools created with this configuration instance. |
long |
getSoftMinEvictableIdleTimeMillis()
Get the value for the
softMinEvictableIdleTimeMillis
configuration attribute for pools created with this configuration
instance. |
boolean |
getTestOnBorrow()
Get the value for the
testOnBorrow configuration attribute for
pools created with this configuration instance. |
boolean |
getTestOnCreate()
Get the value for the
testOnCreate configuration attribute for
pools created with this configuration instance. |
boolean |
getTestOnReturn()
Get the value for the
testOnReturn configuration attribute for
pools created with this configuration instance. |
boolean |
getTestWhileIdle()
Get the value for the
testWhileIdle configuration attribute for
pools created with this configuration instance. |
long |
getTimeBetweenEvictionRunsMillis()
Get the value for the
timeBetweenEvictionRunsMillis configuration
attribute for pools created with this configuration instance. |
void |
setBlockWhenExhausted(boolean blockWhenExhausted)
Set the value for the
blockWhenExhausted configuration attribute
for pools created with this configuration instance. |
void |
setEvictionPolicy(EvictionPolicy<T> evictionPolicy)
Set the value for the
evictionPolicyClass configuration
attribute for pools created with this configuration instance. |
void |
setEvictionPolicyClassName(java.lang.String evictionPolicyClassName)
Set the value for the
evictionPolicyClassName configuration
attribute for pools created with this configuration instance. |
void |
setEvictorShutdownTimeoutMillis(long evictorShutdownTimeoutMillis)
Set the value for the
evictorShutdownTimeoutMillis configuration
attribute for pools created with this configuration instance. |
void |
setFairness(boolean fairness)
Set the value for the
fairness configuration attribute for pools
created with this configuration instance. |
void |
setJmxEnabled(boolean jmxEnabled)
Sets the value of the flag that determines if JMX will be enabled for
pools created with this configuration instance.
|
void |
setJmxNameBase(java.lang.String jmxNameBase)
Sets the value of the JMX name base that will be used as part of the
name assigned to JMX enabled pools created with this configuration
instance.
|
void |
setJmxNamePrefix(java.lang.String jmxNamePrefix)
Sets the value of the JMX name prefix that will be used as part of the
name assigned to JMX enabled pools created with this configuration
instance.
|
void |
setLifo(boolean lifo)
Set the value for the
lifo configuration attribute for pools
created with this configuration instance. |
void |
setMaxWaitMillis(long maxWaitMillis)
Set the value for the
maxWait configuration attribute for pools
created with this configuration instance. |
void |
setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
Set the value for the
minEvictableIdleTimeMillis configuration
attribute for pools created with this configuration instance. |
void |
setNumTestsPerEvictionRun(int numTestsPerEvictionRun)
Set the value for the
numTestsPerEvictionRun configuration
attribute for pools created with this configuration instance. |
void |
setSoftMinEvictableIdleTimeMillis(long softMinEvictableIdleTimeMillis)
Set the value for the
softMinEvictableIdleTimeMillis
configuration attribute for pools created with this configuration
instance. |
void |
setTestOnBorrow(boolean testOnBorrow)
Set the value for the
testOnBorrow configuration attribute for
pools created with this configuration instance. |
void |
setTestOnCreate(boolean testOnCreate)
Set the value for the
testOnCreate configuration attribute for
pools created with this configuration instance. |
void |
setTestOnReturn(boolean testOnReturn)
Set the value for the
testOnReturn configuration attribute for
pools created with this configuration instance. |
void |
setTestWhileIdle(boolean testWhileIdle)
Set the value for the
testWhileIdle configuration attribute for
pools created with this configuration instance. |
void |
setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
Set the value for the
timeBetweenEvictionRunsMillis configuration
attribute for pools created with this configuration instance. |
protected void |
toStringAppendFields(java.lang.StringBuilder builder)
Used by sub-classes to include the fields defined by the sub-class in the
BaseObject.toString() output. |
toString
public static final boolean DEFAULT_LIFO
lifo
configuration attribute.public static final boolean DEFAULT_FAIRNESS
fairness
configuration attribute.public static final long DEFAULT_MAX_WAIT_MILLIS
maxWait
configuration attribute.public static final long DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS
minEvictableIdleTimeMillis
configuration attribute.public static final long DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS
softMinEvictableIdleTimeMillis
configuration attribute.public static final long DEFAULT_EVICTOR_SHUTDOWN_TIMEOUT_MILLIS
evictorShutdownTimeoutMillis
configuration
attribute.public static final int DEFAULT_NUM_TESTS_PER_EVICTION_RUN
numTestsPerEvictionRun
configuration
attribute.public static final boolean DEFAULT_TEST_ON_CREATE
testOnCreate
configuration attribute.public static final boolean DEFAULT_TEST_ON_BORROW
testOnBorrow
configuration attribute.public static final boolean DEFAULT_TEST_ON_RETURN
testOnReturn
configuration attribute.public static final boolean DEFAULT_TEST_WHILE_IDLE
testWhileIdle
configuration attribute.public static final long DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS
timeBetweenEvictionRunsMillis
configuration attribute.public static final boolean DEFAULT_BLOCK_WHEN_EXHAUSTED
blockWhenExhausted
configuration
attribute.public static final boolean DEFAULT_JMX_ENABLE
public static final java.lang.String DEFAULT_JMX_NAME_PREFIX
public static final java.lang.String DEFAULT_JMX_NAME_BASE
null
which means the pool will provide the base name to use.public static final java.lang.String DEFAULT_EVICTION_POLICY_CLASS_NAME
evictionPolicyClassName
configuration
attribute.public boolean getLifo()
lifo
configuration attribute for pools
created with this configuration instance.lifo
for this configuration
instanceBaseGenericObjectPool.getLifo()
,
BaseGenericObjectPool.getLifo()
public boolean getFairness()
fairness
configuration attribute for pools
created with this configuration instance.fairness
for this configuration
instanceBaseGenericObjectPool.getFairness()
,
BaseGenericObjectPool.getFairness()
public void setLifo(boolean lifo)
lifo
configuration attribute for pools
created with this configuration instance.lifo
- The new setting of lifo
for this configuration instanceBaseGenericObjectPool.getLifo()
,
BaseGenericObjectPool.getLifo()
public void setFairness(boolean fairness)
fairness
configuration attribute for pools
created with this configuration instance.fairness
- The new setting of fairness
for this configuration instanceBaseGenericObjectPool.getFairness()
,
BaseGenericObjectPool.getFairness()
public long getMaxWaitMillis()
maxWait
configuration attribute for pools
created with this configuration instance.maxWait
for this
configuration instanceBaseGenericObjectPool.getMaxWaitMillis()
,
BaseGenericObjectPool.getMaxWaitMillis()
public void setMaxWaitMillis(long maxWaitMillis)
maxWait
configuration attribute for pools
created with this configuration instance.maxWaitMillis
- The new setting of maxWaitMillis
for this configuration instanceBaseGenericObjectPool.getMaxWaitMillis()
,
BaseGenericObjectPool.getMaxWaitMillis()
public long getMinEvictableIdleTimeMillis()
minEvictableIdleTimeMillis
configuration
attribute for pools created with this configuration instance.minEvictableIdleTimeMillis
for
this configuration instanceBaseGenericObjectPool.getMinEvictableIdleTimeMillis()
,
BaseGenericObjectPool.getMinEvictableIdleTimeMillis()
public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
minEvictableIdleTimeMillis
configuration
attribute for pools created with this configuration instance.minEvictableIdleTimeMillis
- The new setting of
minEvictableIdleTimeMillis
for this configuration instanceBaseGenericObjectPool.getMinEvictableIdleTimeMillis()
,
BaseGenericObjectPool.getMinEvictableIdleTimeMillis()
public long getSoftMinEvictableIdleTimeMillis()
softMinEvictableIdleTimeMillis
configuration attribute for pools created with this configuration
instance.softMinEvictableIdleTimeMillis
for this configuration instanceBaseGenericObjectPool.getSoftMinEvictableIdleTimeMillis()
,
BaseGenericObjectPool.getSoftMinEvictableIdleTimeMillis()
public void setSoftMinEvictableIdleTimeMillis(long softMinEvictableIdleTimeMillis)
softMinEvictableIdleTimeMillis
configuration attribute for pools created with this configuration
instance.softMinEvictableIdleTimeMillis
- The new setting of
softMinEvictableIdleTimeMillis
for this configuration
instanceBaseGenericObjectPool.getSoftMinEvictableIdleTimeMillis()
,
BaseGenericObjectPool.getSoftMinEvictableIdleTimeMillis()
public int getNumTestsPerEvictionRun()
numTestsPerEvictionRun
configuration
attribute for pools created with this configuration instance.numTestsPerEvictionRun
for this
configuration instanceBaseGenericObjectPool.getNumTestsPerEvictionRun()
,
BaseGenericObjectPool.getNumTestsPerEvictionRun()
public void setNumTestsPerEvictionRun(int numTestsPerEvictionRun)
numTestsPerEvictionRun
configuration
attribute for pools created with this configuration instance.numTestsPerEvictionRun
- The new setting of
numTestsPerEvictionRun
for this configuration instanceBaseGenericObjectPool.getNumTestsPerEvictionRun()
,
BaseGenericObjectPool.getNumTestsPerEvictionRun()
public long getEvictorShutdownTimeoutMillis()
evictorShutdownTimeoutMillis
configuration
attribute for pools created with this configuration instance.evictorShutdownTimeoutMillis
for
this configuration instanceBaseGenericObjectPool.getEvictorShutdownTimeoutMillis()
,
BaseGenericObjectPool.getEvictorShutdownTimeoutMillis()
public void setEvictorShutdownTimeoutMillis(long evictorShutdownTimeoutMillis)
evictorShutdownTimeoutMillis
configuration
attribute for pools created with this configuration instance.evictorShutdownTimeoutMillis
- The new setting of
evictorShutdownTimeoutMillis
for this configuration
instanceBaseGenericObjectPool.getEvictorShutdownTimeoutMillis()
,
BaseGenericObjectPool.getEvictorShutdownTimeoutMillis()
public boolean getTestOnCreate()
testOnCreate
configuration attribute for
pools created with this configuration instance.testOnCreate
for this
configuration instanceBaseGenericObjectPool.getTestOnCreate()
,
BaseGenericObjectPool.getTestOnCreate()
public void setTestOnCreate(boolean testOnCreate)
testOnCreate
configuration attribute for
pools created with this configuration instance.testOnCreate
- The new setting of testOnCreate
for this configuration instanceBaseGenericObjectPool.getTestOnCreate()
,
BaseGenericObjectPool.getTestOnCreate()
public boolean getTestOnBorrow()
testOnBorrow
configuration attribute for
pools created with this configuration instance.testOnBorrow
for this
configuration instanceBaseGenericObjectPool.getTestOnBorrow()
,
BaseGenericObjectPool.getTestOnBorrow()
public void setTestOnBorrow(boolean testOnBorrow)
testOnBorrow
configuration attribute for
pools created with this configuration instance.testOnBorrow
- The new setting of testOnBorrow
for this configuration instanceBaseGenericObjectPool.getTestOnBorrow()
,
BaseGenericObjectPool.getTestOnBorrow()
public boolean getTestOnReturn()
testOnReturn
configuration attribute for
pools created with this configuration instance.testOnReturn
for this
configuration instanceBaseGenericObjectPool.getTestOnReturn()
,
BaseGenericObjectPool.getTestOnReturn()
public void setTestOnReturn(boolean testOnReturn)
testOnReturn
configuration attribute for
pools created with this configuration instance.testOnReturn
- The new setting of testOnReturn
for this configuration instanceBaseGenericObjectPool.getTestOnReturn()
,
BaseGenericObjectPool.getTestOnReturn()
public boolean getTestWhileIdle()
testWhileIdle
configuration attribute for
pools created with this configuration instance.testWhileIdle
for this
configuration instanceBaseGenericObjectPool.getTestWhileIdle()
,
BaseGenericObjectPool.getTestWhileIdle()
public void setTestWhileIdle(boolean testWhileIdle)
testWhileIdle
configuration attribute for
pools created with this configuration instance.testWhileIdle
- The new setting of testWhileIdle
for this configuration instanceBaseGenericObjectPool.getTestWhileIdle()
,
BaseGenericObjectPool.getTestWhileIdle()
public long getTimeBetweenEvictionRunsMillis()
timeBetweenEvictionRunsMillis
configuration
attribute for pools created with this configuration instance.timeBetweenEvictionRunsMillis
for
this configuration instanceBaseGenericObjectPool.getTimeBetweenEvictionRunsMillis()
,
BaseGenericObjectPool.getTimeBetweenEvictionRunsMillis()
public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
timeBetweenEvictionRunsMillis
configuration
attribute for pools created with this configuration instance.timeBetweenEvictionRunsMillis
- The new setting of
timeBetweenEvictionRunsMillis
for this configuration
instanceBaseGenericObjectPool.getTimeBetweenEvictionRunsMillis()
,
BaseGenericObjectPool.getTimeBetweenEvictionRunsMillis()
public EvictionPolicy<T> getEvictionPolicy()
evictionPolicyClass
configuration
attribute for pools created with this configuration instance.evictionPolicyClass
for this
configuration instanceBaseGenericObjectPool.getEvictionPolicy()
,
BaseGenericObjectPool.getEvictionPolicy()
public java.lang.String getEvictionPolicyClassName()
evictionPolicyClassName
configuration
attribute for pools created with this configuration instance.evictionPolicyClassName
for this
configuration instanceBaseGenericObjectPool.getEvictionPolicyClassName()
,
BaseGenericObjectPool.getEvictionPolicyClassName()
public void setEvictionPolicy(EvictionPolicy<T> evictionPolicy)
evictionPolicyClass
configuration
attribute for pools created with this configuration instance.evictionPolicy
- The new setting of
evictionPolicyClass
for this configuration instanceBaseGenericObjectPool.getEvictionPolicy()
,
BaseGenericObjectPool.getEvictionPolicy()
public void setEvictionPolicyClassName(java.lang.String evictionPolicyClassName)
evictionPolicyClassName
configuration
attribute for pools created with this configuration instance.evictionPolicyClassName
- The new setting of
evictionPolicyClassName
for this configuration instanceBaseGenericObjectPool.getEvictionPolicyClassName()
,
BaseGenericObjectPool.getEvictionPolicyClassName()
public boolean getBlockWhenExhausted()
blockWhenExhausted
configuration attribute
for pools created with this configuration instance.blockWhenExhausted
for this
configuration instanceBaseGenericObjectPool.getBlockWhenExhausted()
,
BaseGenericObjectPool.getBlockWhenExhausted()
public void setBlockWhenExhausted(boolean blockWhenExhausted)
blockWhenExhausted
configuration attribute
for pools created with this configuration instance.blockWhenExhausted
- The new setting of blockWhenExhausted
for this configuration instanceBaseGenericObjectPool.getBlockWhenExhausted()
,
BaseGenericObjectPool.getBlockWhenExhausted()
public boolean getJmxEnabled()
jmxEnabled
for this configuration
instancepublic void setJmxEnabled(boolean jmxEnabled)
jmxEnabled
- The new setting of jmxEnabled
for this configuration instancepublic java.lang.String getJmxNameBase()
null
means that the pool will define
the JMX name base.jmxNameBase
for this
configuration instancepublic void setJmxNameBase(java.lang.String jmxNameBase)
null
means that the pool will define
the JMX name base.jmxNameBase
- The new setting of jmxNameBase
for this configuration instancepublic java.lang.String getJmxNamePrefix()
jmxNamePrefix
for this
configuration instancepublic void setJmxNamePrefix(java.lang.String jmxNamePrefix)
jmxNamePrefix
- The new setting of jmxNamePrefix
for this configuration instanceprotected void toStringAppendFields(java.lang.StringBuilder builder)
BaseObject
BaseObject.toString()
output.toStringAppendFields
in class BaseObject
builder
- Field names and values are appended to this objectCopyright © 2000-2018 Apache Software Foundation. All Rights Reserved.