Class DefaultEvictionPolicy<T>
- java.lang.Object
- 
- org.apache.tomcat.dbcp.pool2.impl.DefaultEvictionPolicy<T>
 
- 
- Type Parameters:
- T- the type of objects in the pool.
 - All Implemented Interfaces:
- EvictionPolicy<T>
 
 public class DefaultEvictionPolicy<T> extends java.lang.Object implements EvictionPolicy<T> Provides the default implementation ofEvictionPolicyused by the pools.Objects will be evicted if the following conditions are met: - The object has been idle longer than
     BaseGenericObjectPool.getMinEvictableIdleDuration()/BaseGenericObjectPool.getMinEvictableIdleDuration()
- There are more than GenericObjectPool.getMinIdle()/GenericKeyedObjectPoolConfig.getMinIdlePerKey()idle objects in the pool and the object has been idle for longer thanBaseGenericObjectPool.getSoftMinEvictableIdleDuration()/BaseGenericObjectPool.getSoftMinEvictableIdleDuration()
 This class is immutable and thread-safe. - Since:
- 2.0
 
- 
- 
Constructor SummaryConstructors Constructor Description DefaultEvictionPolicy()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanevict(EvictionConfig config, PooledObject<T> underTest, int idleCount)This method is called to test if an idle object in the pool should be evicted or not.
 
- 
- 
- 
Method Detail- 
evictpublic boolean evict(EvictionConfig config, PooledObject<T> underTest, int idleCount) Description copied from interface:EvictionPolicyThis method is called to test if an idle object in the pool should be evicted or not.- Specified by:
- evictin interface- EvictionPolicy<T>
- Parameters:
- config- The pool configuration settings related to eviction
- underTest- The pooled object being tested for eviction
- idleCount- The current number of idle objects in the pool including the object under test
- Returns:
- trueif the object should be evicted, otherwise- false
 
 
- 
 
-