T- the type of objects in the pool.
public class DefaultEvictionPolicy<T> extends Object implements EvictionPolicy<T>
EvictionPolicyused by the pools.
Objects will be evicted if the following conditions are met:
GenericKeyedObjectPoolConfig.getMinIdlePerKey()idle objects in the pool and the object has been idle for longer than
This class is immutable and thread-safe.
|Constructor and Description|
|Modifier and Type||Method and Description|
This method is called to test if an idle object in the pool should be evicted or not.
public boolean evict(EvictionConfig config, PooledObject<T> underTest, int idleCount)
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
trueif the object should be evicted, otherwise
Copyright © 2001–2021 The Apache Software Foundation. All rights reserved.