Example usage for org.apache.commons.pool.impl GenericObjectPool setConfig

List of usage examples for org.apache.commons.pool.impl GenericObjectPool setConfig

Introduction

In this page you can find the example usage for org.apache.commons.pool.impl GenericObjectPool setConfig.

Prototype

public synchronized void setConfig(GenericObjectPool.Config conf) 

Source Link

Document

Sets my configuration.

Usage

From source file:edu.illinois.enforcemop.examples.apache.pool.TestGenericObjectPool.java

public void testSetConfig() throws Exception {
    GenericObjectPool.Config expected = new GenericObjectPool.Config();
    GenericObjectPool pool = new GenericObjectPool();
    assertConfiguration(expected, pool);
    expected.maxActive = 2;/*from  w  ww  . ja  va  2s  . c  o m*/
    expected.maxIdle = 3;
    expected.maxWait = 5L;
    expected.minEvictableIdleTimeMillis = 7L;
    expected.numTestsPerEvictionRun = 9;
    expected.testOnBorrow = true;
    expected.testOnReturn = true;
    expected.testWhileIdle = true;
    expected.timeBetweenEvictionRunsMillis = 11L;
    expected.whenExhaustedAction = GenericObjectPool.WHEN_EXHAUSTED_GROW;
    pool.setConfig(expected);
    assertConfiguration(expected, pool);
}