Class GenericObjectPoolConfig<T>
- java.lang.Object
-
- org.apache.tomcat.dbcp.pool2.BaseObject
-
- org.apache.tomcat.dbcp.pool2.impl.BaseObjectPoolConfig<T>
-
- org.apache.tomcat.dbcp.pool2.impl.GenericObjectPoolConfig<T>
-
- Type Parameters:
T- Type of element pooled.
- All Implemented Interfaces:
java.lang.Cloneable
public class GenericObjectPoolConfig<T> extends BaseObjectPoolConfig<T>
A simple "struct" encapsulating the configuration for aGenericObjectPool.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
Fields Modifier and Type Field Description static intDEFAULT_MAX_IDLEThe default value for themaxIdleconfiguration attribute.static intDEFAULT_MAX_TOTALThe default value for themaxTotalconfiguration attribute.static intDEFAULT_MIN_IDLEThe default value for theminIdleconfiguration attribute.-
Fields inherited from class org.apache.tomcat.dbcp.pool2.impl.BaseObjectPoolConfig
DEFAULT_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 Summary
Constructors Constructor Description GenericObjectPoolConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GenericObjectPoolConfig<T>clone()intgetMaxIdle()Get the value for themaxIdleconfiguration attribute for pools created with this configuration instance.intgetMaxTotal()Get the value for themaxTotalconfiguration attribute for pools created with this configuration instance.intgetMinIdle()Get the value for theminIdleconfiguration attribute for pools created with this configuration instance.voidsetMaxIdle(int maxIdle)Set the value for themaxIdleconfiguration attribute for pools created with this configuration instance.voidsetMaxTotal(int maxTotal)Set the value for themaxTotalconfiguration attribute for pools created with this configuration instance.voidsetMinIdle(int minIdle)Set the value for theminIdleconfiguration 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.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, setMinEvictableIdleTime, setMinEvictableIdleTimeMillis, setNumTestsPerEvictionRun, setSoftMinEvictableIdleTime, setSoftMinEvictableIdleTimeMillis, setTestOnBorrow, setTestOnCreate, setTestOnReturn, setTestWhileIdle, setTimeBetweenEvictionRuns, setTimeBetweenEvictionRunsMillis
-
Methods inherited from class org.apache.tomcat.dbcp.pool2.BaseObject
toString
-
-
-
-
Field Detail
-
DEFAULT_MAX_TOTAL
public static final int DEFAULT_MAX_TOTAL
The default value for themaxTotalconfiguration attribute.
-
DEFAULT_MAX_IDLE
public static final int DEFAULT_MAX_IDLE
The default value for themaxIdleconfiguration attribute.
-
DEFAULT_MIN_IDLE
public static final int DEFAULT_MIN_IDLE
The default value for theminIdleconfiguration attribute.
-
-
Method Detail
-
clone
public GenericObjectPoolConfig<T> clone()
- Overrides:
clonein classjava.lang.Object
-
getMaxIdle
public int getMaxIdle()
Get the value for themaxIdleconfiguration attribute for pools created with this configuration instance.- Returns:
- The current setting of
maxIdlefor this configuration instance - See Also:
GenericObjectPool.getMaxIdle()
-
getMaxTotal
public 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()
-
getMinIdle
public int getMinIdle()
Get the value for theminIdleconfiguration attribute for pools created with this configuration instance.- Returns:
- The current setting of
minIdlefor this configuration instance - See Also:
GenericObjectPool.getMinIdle()
-
setMaxIdle
public void setMaxIdle(int maxIdle)
Set the value for themaxIdleconfiguration attribute for pools created with this configuration instance.- Parameters:
maxIdle- The new setting ofmaxIdlefor this configuration instance- See Also:
GenericObjectPool.setMaxIdle(int)
-
setMaxTotal
public void setMaxTotal(int maxTotal)
Set the value for themaxTotalconfiguration attribute for pools created with this configuration instance.- Parameters:
maxTotal- The new setting ofmaxTotalfor this configuration instance- See Also:
BaseGenericObjectPool.setMaxTotal(int)
-
setMinIdle
public void setMinIdle(int minIdle)
Set the value for theminIdleconfiguration attribute for pools created with this configuration instance.- Parameters:
minIdle- The new setting ofminIdlefor this configuration instance- See Also:
GenericObjectPool.setMinIdle(int)
-
toStringAppendFields
protected 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 classBaseObjectPoolConfig<T>- Parameters:
builder- Field names and values are appended to this object
-
-