Class GenericKeyedObjectPoolConfig<T>
java.lang.Object
org.apache.tomcat.dbcp.pool2.BaseObject
org.apache.tomcat.dbcp.pool2.impl.BaseObjectPoolConfig<T>
org.apache.tomcat.dbcp.pool2.impl.GenericKeyedObjectPoolConfig<T>
- Type Parameters:
T
- Type of element pooled.
- All Implemented Interfaces:
Cloneable
A simple structure encapsulating the configuration for a
GenericKeyedObjectPool
.
This class is not thread-safe; it is only intended to be used to provide attributes used when creating a pool.
- Since:
- 2.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The default value for themaxIdlePerKey
configuration attribute.static final int
The default value for themaxTotal
configuration attribute.static final int
The default value for themaxTotalPerKey
configuration attribute.static final int
The default value for theminIdlePerKey
configuration attribute.Fields inherited from class org.apache.tomcat.dbcp.pool2.impl.BaseObjectPoolConfig
DEFAULT_BLOCK_WHEN_EXHAUSTED, DEFAULT_DURATION_BETWEEN_EVICTION_RUNS, DEFAULT_EVICTION_POLICY_CLASS_NAME, DEFAULT_EVICTOR_SHUTDOWN_TIMEOUT, DEFAULT_EVICTOR_SHUTDOWN_TIMEOUT_MILLIS, DEFAULT_FAIRNESS, DEFAULT_JMX_ENABLE, DEFAULT_JMX_NAME_BASE, DEFAULT_JMX_NAME_PREFIX, DEFAULT_LIFO, DEFAULT_MAX_WAIT, DEFAULT_MAX_WAIT_MILLIS, DEFAULT_MIN_EVICTABLE_IDLE_DURATION, DEFAULT_MIN_EVICTABLE_IDLE_TIME, DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_NUM_TESTS_PER_EVICTION_RUN, DEFAULT_SOFT_MIN_EVICTABLE_IDLE_DURATION, DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME, DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_TEST_ON_BORROW, DEFAULT_TEST_ON_CREATE, DEFAULT_TEST_ON_RETURN, DEFAULT_TEST_WHILE_IDLE, DEFAULT_TIME_BETWEEN_EVICTION_RUNS, DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS
-
Constructor Summary
ConstructorDescriptionConstructs a new configuration with default settings. -
Method Summary
Modifier and TypeMethodDescriptionclone()
int
Get the value for themaxIdlePerKey
configuration attribute for pools created with this configuration instance.int
Get the value for themaxTotal
configuration attribute for pools created with this configuration instance.int
Get the value for themaxTotalPerKey
configuration attribute for pools created with this configuration instance.int
Get the value for theminIdlePerKey
configuration attribute for pools created with this configuration instance.void
setMaxIdlePerKey
(int maxIdlePerKey) Set the value for themaxIdlePerKey
configuration attribute for pools created with this configuration instance.void
setMaxTotal
(int maxTotal) Set the value for themaxTotal
configuration attribute for pools created with this configuration instance.void
setMaxTotalPerKey
(int maxTotalPerKey) Set the value for themaxTotalPerKey
configuration attribute for pools created with this configuration instance.void
setMinIdlePerKey
(int minIdlePerKey) Set the value for theminIdlePerKey
configuration attribute for pools created with this configuration instance.protected void
toStringAppendFields
(StringBuilder builder) Used by sub-classes to include the fields defined by the sub-class in theBaseObject.toString()
output.Methods inherited from class org.apache.tomcat.dbcp.pool2.impl.BaseObjectPoolConfig
getBlockWhenExhausted, getDurationBetweenEvictionRuns, getEvictionPolicy, getEvictionPolicyClassName, getEvictorShutdownTimeout, getEvictorShutdownTimeoutDuration, getEvictorShutdownTimeoutMillis, getFairness, getJmxEnabled, getJmxNameBase, getJmxNamePrefix, getLifo, getMaxWaitDuration, getMaxWaitMillis, getMinEvictableIdleDuration, getMinEvictableIdleTime, getMinEvictableIdleTimeMillis, getNumTestsPerEvictionRun, getSoftMinEvictableIdleDuration, getSoftMinEvictableIdleTime, getSoftMinEvictableIdleTimeMillis, getTestOnBorrow, getTestOnCreate, getTestOnReturn, getTestWhileIdle, getTimeBetweenEvictionRuns, getTimeBetweenEvictionRunsMillis, setBlockWhenExhausted, setEvictionPolicy, setEvictionPolicyClassName, setEvictorShutdownTimeout, setEvictorShutdownTimeoutMillis, setEvictorShutdownTimeoutMillis, setFairness, setJmxEnabled, setJmxNameBase, setJmxNamePrefix, setLifo, setMaxWait, setMaxWaitMillis, setMinEvictableIdleDuration, setMinEvictableIdleTime, setMinEvictableIdleTimeMillis, setNumTestsPerEvictionRun, setSoftMinEvictableIdleDuration, setSoftMinEvictableIdleTime, setSoftMinEvictableIdleTimeMillis, setTestOnBorrow, setTestOnCreate, setTestOnReturn, setTestWhileIdle, setTimeBetweenEvictionRuns, setTimeBetweenEvictionRunsMillis
Methods inherited from class org.apache.tomcat.dbcp.pool2.BaseObject
toString
-
Field Details
-
DEFAULT_MAX_TOTAL_PER_KEY
public static final int DEFAULT_MAX_TOTAL_PER_KEYThe default value for themaxTotalPerKey
configuration attribute. -
DEFAULT_MAX_TOTAL
public static final int DEFAULT_MAX_TOTALThe default value for themaxTotal
configuration attribute. -
DEFAULT_MIN_IDLE_PER_KEY
public static final int DEFAULT_MIN_IDLE_PER_KEYThe default value for theminIdlePerKey
configuration attribute. -
DEFAULT_MAX_IDLE_PER_KEY
public static final int DEFAULT_MAX_IDLE_PER_KEYThe default value for themaxIdlePerKey
configuration attribute.
-
-
Constructor Details
-
GenericKeyedObjectPoolConfig
public GenericKeyedObjectPoolConfig()Constructs a new configuration with default settings.
-
-
Method Details
-
clone
-
getMaxIdlePerKey
public int getMaxIdlePerKey()Get the value for themaxIdlePerKey
configuration attribute for pools created with this configuration instance.- Returns:
- The current setting of
maxIdlePerKey
for this configuration instance - See Also:
-
getMaxTotal
public int getMaxTotal()Get the value for themaxTotal
configuration attribute for pools created with this configuration instance.- Returns:
- The current setting of
maxTotal
for this configuration instance - See Also:
-
getMaxTotalPerKey
public int getMaxTotalPerKey()Get the value for themaxTotalPerKey
configuration attribute for pools created with this configuration instance.- Returns:
- The current setting of
maxTotalPerKey
for this configuration instance - See Also:
-
getMinIdlePerKey
public int getMinIdlePerKey()Get the value for theminIdlePerKey
configuration attribute for pools created with this configuration instance.- Returns:
- The current setting of
minIdlePerKey
for this configuration instance - See Also:
-
setMaxIdlePerKey
public void setMaxIdlePerKey(int maxIdlePerKey) Set the value for themaxIdlePerKey
configuration attribute for pools created with this configuration instance.- Parameters:
maxIdlePerKey
- The new setting ofmaxIdlePerKey
for this configuration instance- See Also:
-
setMaxTotal
public void setMaxTotal(int maxTotal) Set the value for themaxTotal
configuration attribute for pools created with this configuration instance.- Parameters:
maxTotal
- The new setting ofmaxTotal
for this configuration instance- See Also:
-
setMaxTotalPerKey
public void setMaxTotalPerKey(int maxTotalPerKey) Set the value for themaxTotalPerKey
configuration attribute for pools created with this configuration instance.- Parameters:
maxTotalPerKey
- The new setting ofmaxTotalPerKey
for this configuration instance- See Also:
-
setMinIdlePerKey
public void setMinIdlePerKey(int minIdlePerKey) Set the value for theminIdlePerKey
configuration attribute for pools created with this configuration instance.- Parameters:
minIdlePerKey
- The new setting ofminIdlePerKey
for this configuration instance- See Also:
-
toStringAppendFields
Description copied from class:BaseObject
Used by sub-classes to include the fields defined by the sub-class in theBaseObject.toString()
output.- Overrides:
toStringAppendFields
in classBaseObjectPoolConfig<T>
- Parameters:
builder
- Field names and values are appended to this object
-