T
- the type of objects in the poolEvictionPolicy<T>
public class DefaultEvictionPolicy<T> extends java.lang.Object implements EvictionPolicy<T>
EvictionPolicy
used by the
pools. Objects will be evicted if the following conditions are met:
BaseGenericObjectPool.getMinEvictableIdleTimeMillis()
/
BaseGenericObjectPool.getMinEvictableIdleTimeMillis()
GenericObjectPool.getMinIdle()
/
GenericKeyedObjectPoolConfig.getMinIdlePerKey()
idle objects in
the pool and the object has been idle for longer than
BaseGenericObjectPool.getSoftMinEvictableIdleTimeMillis()
/
BaseGenericObjectPool.getSoftMinEvictableIdleTimeMillis()
Constructor | Description |
---|---|
DefaultEvictionPolicy() |
Modifier and Type | Method | Description |
---|---|---|
boolean |
evict(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.
|
public boolean evict(EvictionConfig config, PooledObject<T> underTest, int idleCount)
EvictionPolicy
evict
in interface EvictionPolicy<T>
config
- The pool configuration settings related to evictionunderTest
- The pooled object being tested for evictionidleCount
- The current number of idle objects in the pool including
the object under testtrue
if the object should be evicted, otherwise
false
Copyright © 2001-2014 Apache Software Foundation. Documenation generated September 14 2017.