Example usage for org.apache.commons.pool2 PoolUtils erodingPool

List of usage examples for org.apache.commons.pool2 PoolUtils erodingPool

Introduction

In this page you can find the example usage for org.apache.commons.pool2 PoolUtils erodingPool.

Prototype

public static <K, V> KeyedObjectPool<K, V> erodingPool(final KeyedObjectPool<K, V> keyedPool) 

Source Link

Document

Returns a pool that adaptively decreases its size when idle objects are no longer needed.

Usage

From source file:com.kurento.kmf.thrift.pool.AbstractPool.java

protected void init(BasePooledObjectFactory<T> factory) {
    GenericObjectPoolConfig config = new GenericObjectPoolConfig();
    config.setMinIdle(apiConfig.getClientPoolSize());
    config.setTestOnBorrow(true);//from w w w . j  a  va 2s. co  m
    config.setTestOnReturn(true);
    this.pool = PoolUtils.erodingPool(new GenericObjectPool<>(factory, config));
}