Class EvictionConfig
java.lang.Object
org.apache.tomcat.dbcp.pool2.impl.EvictionConfig
This class is used by pool implementations to pass configuration information
to
EvictionPolicy
instances. The EvictionPolicy
may also have
its own specific configuration attributes.
This class is immutable and thread-safe.
- Since:
- 2.0
-
Constructor Summary
ConstructorDescriptionEvictionConfig
(long poolIdleEvictTime, long poolIdleSoftEvictTime, int minIdle) Create a new eviction configuration with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionlong
Obtain theidleEvictTime
for this eviction configuration instance.long
Obtain theidleSoftEvictTime
for this eviction configuration instance.int
Obtain theminIdle
for this eviction configuration instance.toString()
-
Constructor Details
-
EvictionConfig
public EvictionConfig(long poolIdleEvictTime, long poolIdleSoftEvictTime, int minIdle) Create a new eviction configuration with the specified parameters. Instances are immutable.- Parameters:
poolIdleEvictTime
- Expected to be provided byBaseGenericObjectPool.getMinEvictableIdleTimeMillis()
poolIdleSoftEvictTime
- Expected to be provided byBaseGenericObjectPool.getSoftMinEvictableIdleTimeMillis()
minIdle
- Expected to be provided byGenericObjectPool.getMinIdle()
orGenericKeyedObjectPool.getMinIdlePerKey()
-
-
Method Details
-
getIdleEvictTime
public long getIdleEvictTime()Obtain theidleEvictTime
for this eviction configuration instance.How the evictor behaves based on this value will be determined by the configured
EvictionPolicy
.- Returns:
- The
idleEvictTime
in milliseconds
-
getIdleSoftEvictTime
public long getIdleSoftEvictTime()Obtain theidleSoftEvictTime
for this eviction configuration instance.How the evictor behaves based on this value will be determined by the configured
EvictionPolicy
.- Returns:
- The (@code idleSoftEvictTime} in milliseconds
-
getMinIdle
public int getMinIdle()Obtain theminIdle
for this eviction configuration instance.How the evictor behaves based on this value will be determined by the configured
EvictionPolicy
.- Returns:
- The
minIdle
-
toString
-