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:
- java.lang.Cloneable
 
 public class GenericKeyedObjectPoolConfig<T> extends BaseObjectPoolConfig<T> A simple "struct" encapsulating the configuration for aGenericKeyedObjectPool.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 SummaryFields Modifier and Type Field Description static intDEFAULT_MAX_IDLE_PER_KEYThe default value for themaxIdlePerKeyconfiguration attribute.static intDEFAULT_MAX_TOTALThe default value for themaxTotalconfiguration attribute.static intDEFAULT_MAX_TOTAL_PER_KEYThe default value for themaxTotalPerKeyconfiguration attribute.static intDEFAULT_MIN_IDLE_PER_KEYThe default value for theminIdlePerKeyconfiguration attribute.- 
Fields inherited from class org.apache.tomcat.dbcp.pool2.impl.BaseObjectPoolConfigDEFAULT_BLOCK_WHEN_EXHAUSTED, 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 SummaryConstructors Constructor Description GenericKeyedObjectPoolConfig()Constructs a new configuration with default settings.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description GenericKeyedObjectPoolConfig<T>clone()intgetMaxIdlePerKey()Get the value for themaxIdlePerKeyconfiguration attribute for pools created with this configuration instance.intgetMaxTotal()Get the value for themaxTotalconfiguration attribute for pools created with this configuration instance.intgetMaxTotalPerKey()Get the value for themaxTotalPerKeyconfiguration attribute for pools created with this configuration instance.intgetMinIdlePerKey()Get the value for theminIdlePerKeyconfiguration attribute for pools created with this configuration instance.voidsetMaxIdlePerKey(int maxIdlePerKey)Set the value for themaxIdlePerKeyconfiguration attribute for pools created with this configuration instance.voidsetMaxTotal(int maxTotal)Set the value for themaxTotalconfiguration attribute for pools created with this configuration instance.voidsetMaxTotalPerKey(int maxTotalPerKey)Set the value for themaxTotalPerKeyconfiguration attribute for pools created with this configuration instance.voidsetMinIdlePerKey(int minIdlePerKey)Set the value for theminIdlePerKeyconfiguration attribute for pools created with this configuration instance.protected voidtoStringAppendFields(java.lang.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.BaseObjectPoolConfiggetBlockWhenExhausted, 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, setMinEvictableIdleTime, setMinEvictableIdleTimeMillis, setNumTestsPerEvictionRun, setSoftMinEvictableIdleTime, setSoftMinEvictableIdleTimeMillis, setTestOnBorrow, setTestOnCreate, setTestOnReturn, setTestWhileIdle, setTimeBetweenEvictionRuns, setTimeBetweenEvictionRunsMillis
 - 
Methods inherited from class org.apache.tomcat.dbcp.pool2.BaseObjecttoString
 
- 
 
- 
- 
- 
Field Detail- 
DEFAULT_MAX_TOTAL_PER_KEYpublic static final int DEFAULT_MAX_TOTAL_PER_KEY The default value for themaxTotalPerKeyconfiguration attribute.
 - 
DEFAULT_MAX_TOTALpublic static final int DEFAULT_MAX_TOTAL The default value for themaxTotalconfiguration attribute.
 - 
DEFAULT_MIN_IDLE_PER_KEYpublic static final int DEFAULT_MIN_IDLE_PER_KEY The default value for theminIdlePerKeyconfiguration attribute.
 - 
DEFAULT_MAX_IDLE_PER_KEYpublic static final int DEFAULT_MAX_IDLE_PER_KEY The default value for themaxIdlePerKeyconfiguration attribute.
 
- 
 - 
Method Detail- 
clonepublic GenericKeyedObjectPoolConfig<T> clone() - Overrides:
- clonein class- java.lang.Object
 
 - 
getMaxIdlePerKeypublic int getMaxIdlePerKey() Get the value for themaxIdlePerKeyconfiguration attribute for pools created with this configuration instance.- Returns:
- The current setting of maxIdlePerKeyfor this configuration instance
- See Also:
- GenericKeyedObjectPool.getMaxIdlePerKey()
 
 - 
getMaxTotalpublic int getMaxTotal() Get the value for themaxTotalconfiguration attribute for pools created with this configuration instance.- Returns:
- The current setting of maxTotalfor this configuration instance
- See Also:
- BaseGenericObjectPool.getMaxTotal()
 
 - 
getMaxTotalPerKeypublic int getMaxTotalPerKey() Get the value for themaxTotalPerKeyconfiguration attribute for pools created with this configuration instance.- Returns:
- The current setting of maxTotalPerKeyfor this configuration instance
- See Also:
- GenericKeyedObjectPool.getMaxTotalPerKey()
 
 - 
getMinIdlePerKeypublic int getMinIdlePerKey() Get the value for theminIdlePerKeyconfiguration attribute for pools created with this configuration instance.- Returns:
- The current setting of minIdlePerKeyfor this configuration instance
- See Also:
- GenericKeyedObjectPool.getMinIdlePerKey()
 
 - 
setMaxIdlePerKeypublic void setMaxIdlePerKey(int maxIdlePerKey) Set the value for themaxIdlePerKeyconfiguration attribute for pools created with this configuration instance.- Parameters:
- maxIdlePerKey- The new setting of- maxIdlePerKeyfor this configuration instance
- See Also:
- GenericKeyedObjectPool.setMaxIdlePerKey(int)
 
 - 
setMaxTotalpublic void setMaxTotal(int maxTotal) Set the value for themaxTotalconfiguration attribute for pools created with this configuration instance.- Parameters:
- maxTotal- The new setting of- maxTotalfor this configuration instance
- See Also:
- BaseGenericObjectPool.setMaxTotal(int)
 
 - 
setMaxTotalPerKeypublic void setMaxTotalPerKey(int maxTotalPerKey) Set the value for themaxTotalPerKeyconfiguration attribute for pools created with this configuration instance.- Parameters:
- maxTotalPerKey- The new setting of- maxTotalPerKeyfor this configuration instance
- See Also:
- GenericKeyedObjectPool.setMaxTotalPerKey(int)
 
 - 
setMinIdlePerKeypublic void setMinIdlePerKey(int minIdlePerKey) Set the value for theminIdlePerKeyconfiguration attribute for pools created with this configuration instance.- Parameters:
- minIdlePerKey- The new setting of- minIdlePerKeyfor this configuration instance
- See Also:
- GenericKeyedObjectPool.setMinIdlePerKey(int)
 
 - 
toStringAppendFieldsprotected void toStringAppendFields(java.lang.StringBuilder builder) Description copied from class:BaseObjectUsed by sub-classes to include the fields defined by the sub-class in theBaseObject.toString()output.- Overrides:
- toStringAppendFieldsin class- BaseObjectPoolConfig<T>
- Parameters:
- builder- Field names and values are appended to this object
 
 
- 
 
-