Top Description Methods
org.apache.commons.pool2.impl

public Interface EvictionPolicy<T>

Known Direct Implementers
org.apache.commons.pool2.impl.DefaultEvictionPolicy
Type Parameters
<T>
the type of objects in the pool
Imports
org.apache.commons.pool2.PooledObject

To provide a custom eviction policy (i.e. something other than DefaultEvictionPolicy for a pool, users must provide an implementation of this interface that provides the required eviction policy.
Since
2.0

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the object should be evicted, otherwise false
evict
(EvictionConfig
The pool configuration settings related to eviction
config
,
PooledObject<T>
The pooled object being tested for eviction
underTest
,
int
The current number of idle objects in the pool including the object under test
idleCount
)

Tests if an idle object in the pool should be evicted or not.

Method Detail

evictback to summary
public boolean evict(EvictionConfig config, PooledObject<T> underTest, int idleCount)

Tests if an idle object in the pool should be evicted or not.

Parameters
config:EvictionConfig

The pool configuration settings related to eviction

underTest:PooledObject<T>

The pooled object being tested for eviction

idleCount:int

The current number of idle objects in the pool including the object under test

Returns:boolean

true if the object should be evicted, otherwise false