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

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

Introduction

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

Prototype

public synchronized int getMinIdle() 

Source Link

Document

Returns the minimum number of objects allowed in the pool before the evictor thread (if active) spawns new objects.

Usage

From source file:com.adaptris.core.services.splitter.ServiceWorkerPoolLegacyTest.java

@Test
public void testCreateObjectPool() throws Exception {
    GenericObjectPool<ServiceWorkerPool.Worker> pool = createObjectPool();
    assertNotNull(pool);//from  w  ww . j a v  a 2 s  . co  m
    assertEquals(10, pool.getMaxActive());
    assertEquals(10, pool.getMinIdle());
    assertEquals(10, pool.getMaxIdle());
    assertEquals(-1, pool.getMaxWait());
    assertEquals(GenericObjectPool.WHEN_EXHAUSTED_BLOCK, pool.getWhenExhaustedAction());
}

From source file:sce.Main.java

public String getConnectionPoolInfo() {
    JSONObject results_obj = new JSONObject();
    GenericObjectPool pool = connectionPool.getConnectionPool();

    results_obj.put("Lifo", pool.getLifo());
    results_obj.put("MaxActive", pool.getMaxActive());
    results_obj.put("MaxIdle", pool.getMaxIdle());
    results_obj.put("MaxWait", pool.getMaxWait());
    results_obj.put("MinEvictableIdleTimeMillis", pool.getMinEvictableIdleTimeMillis());
    results_obj.put("MinIdle", pool.getMinIdle());
    results_obj.put("NumActive", pool.getNumActive());
    results_obj.put("NumIdle", pool.getNumIdle());
    results_obj.put("NumTestsPerEvictionRun", pool.getNumTestsPerEvictionRun());
    results_obj.put("SoftMinEvictableIdleTimeMillis", pool.getSoftMinEvictableIdleTimeMillis());
    results_obj.put("TestOnBorrow", pool.getTestOnBorrow());
    results_obj.put("TestOnReturn", pool.getTestOnReturn());
    results_obj.put("TestWhileIdle", pool.getTestWhileIdle());
    results_obj.put("TimeBetweenEvictionRunsMillis", pool.getTimeBetweenEvictionRunsMillis());
    results_obj.put("WhenExhaustedAction", pool.getWhenExhaustedAction());

    return results_obj.toJSONString();
}