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

public Class DefaultEvictionPolicy<T>

extends Object
implements EvictionPolicy<T>
Class Inheritance
All Implemented Interfaces
org.apache.commons.pool2.impl.EvictionPolicy
Type Parameters
<T>
the type of objects in the pool.
Imports
org.apache.commons.pool2.PooledObject

Provides the default implementation of EvictionPolicy used by the pools.

Objects will be evicted if the following conditions are met:

This class is immutable and thread-safe.

Since
2.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
evict(final EvictionConfig
The pool configuration settings related to eviction
config
,
final PooledObject<T>
The pooled object being tested for eviction
underTest
,
final int
The current number of idle objects in the pool including the object under test
idleCount
)

Implements org.apache.commons.pool2.impl.EvictionPolicy.evict.

Tests if an idle object in the pool should be evicted or not.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DefaultEvictionPolicyback to summary
public DefaultEvictionPolicy()

Method Detail

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

Implements org.apache.commons.pool2.impl.EvictionPolicy.evict.

Doc from org.apache.commons.pool2.impl.EvictionPolicy.evict.

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

Annotations
@Override