Package org.apache.commons.pool2.impl
Class GenericKeyedObjectPoolConfig<T>
java.lang.Object
org.apache.commons.pool2.BaseObject
org.apache.commons.pool2.impl.BaseObjectPoolConfig<T>
org.apache.commons.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
FieldsModifier and TypeFieldDescriptionstatic final intThe default value for themaxIdlePerKeyconfiguration attribute: 8.static final intThe default value for themaxTotalconfiguration attribute: -1.static final intThe default value for themaxTotalPerKeyconfiguration attribute: 8.static final intThe default value for theminIdlePerKeyconfiguration attribute: 0.Fields inherited from class org.apache.commons.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
ConstructorsConstructorDescriptionConstructs a new configuration with default settings. -
Method Summary
Modifier and TypeMethodDescriptionclone()intGets the value for themaxIdlePerKeyconfiguration attribute for pools created with this configuration instance.intGets the value for themaxTotalconfiguration attribute for pools created with this configuration instance.intGets the value for themaxTotalPerKeyconfiguration attribute for pools created with this configuration instance.intGets the value for theminIdlePerKeyconfiguration attribute for pools created with this configuration instance.voidsetMaxIdlePerKey(int maxIdlePerKey) Sets the value for themaxIdlePerKeyconfiguration attribute for pools created with this configuration instance.voidsetMaxTotal(int maxTotal) Sets the value for themaxTotalconfiguration attribute for pools created with this configuration instance.voidsetMaxTotalPerKey(int maxTotalPerKey) Sets the value for themaxTotalPerKeyconfiguration attribute for pools created with this configuration instance.voidsetMinIdlePerKey(int minIdlePerKey) Sets the value for theminIdlePerKeyconfiguration attribute for pools created with this configuration instance.protected voidtoStringAppendFields(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.commons.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, setTimeBetweenEvictionRunsMillisMethods inherited from class org.apache.commons.pool2.BaseObject
toString
-
Field Details
-
DEFAULT_MAX_TOTAL_PER_KEY
The default value for themaxTotalPerKeyconfiguration attribute: 8.- See Also:
-
DEFAULT_MAX_TOTAL
The default value for themaxTotalconfiguration attribute: -1.- See Also:
-
DEFAULT_MIN_IDLE_PER_KEY
The default value for theminIdlePerKeyconfiguration attribute: 0.- See Also:
-
DEFAULT_MAX_IDLE_PER_KEY
The default value for themaxIdlePerKeyconfiguration attribute: 8.- See Also:
-
-
Constructor Details
-
GenericKeyedObjectPoolConfig
public GenericKeyedObjectPoolConfig()Constructs a new configuration with default settings.
-
-
Method Details
-
clone
-
getMaxIdlePerKey
Gets the value for themaxIdlePerKeyconfiguration attribute for pools created with this configuration instance.- Returns:
- The current setting of
maxIdlePerKeyfor this configuration instance - See Also:
-
getMaxTotal
Gets the value for themaxTotalconfiguration attribute for pools created with this configuration instance.- Returns:
- The current setting of
maxTotalfor this configuration instance - See Also:
-
getMaxTotalPerKey
Gets the value for themaxTotalPerKeyconfiguration attribute for pools created with this configuration instance.- Returns:
- The current setting of
maxTotalPerKeyfor this configuration instance - See Also:
-
getMinIdlePerKey
Gets the value for theminIdlePerKeyconfiguration attribute for pools created with this configuration instance.- Returns:
- The current setting of
minIdlePerKeyfor this configuration instance - See Also:
-
setMaxIdlePerKey
Sets the value for themaxIdlePerKeyconfiguration attribute for pools created with this configuration instance.- Parameters:
maxIdlePerKey- The new setting ofmaxIdlePerKeyfor this configuration instance- See Also:
-
setMaxTotal
Sets the value for themaxTotalconfiguration attribute for pools created with this configuration instance.- Parameters:
maxTotal- The new setting ofmaxTotalfor this configuration instance- See Also:
-
setMaxTotalPerKey
Sets the value for themaxTotalPerKeyconfiguration attribute for pools created with this configuration instance.- Parameters:
maxTotalPerKey- The new setting ofmaxTotalPerKeyfor this configuration instance- See Also:
-
setMinIdlePerKey
Sets the value for theminIdlePerKeyconfiguration attribute for pools created with this configuration instance.- Parameters:
minIdlePerKey- The new setting ofminIdlePerKeyfor this configuration instance- See Also:
-
toStringAppendFields
Description copied from class:BaseObjectUsed by sub-classes to include the fields defined by the sub-class in theBaseObject.toString()output.- Overrides:
toStringAppendFieldsin classBaseObjectPoolConfig<T>- Parameters:
builder- Field names and values are appended to this object
-