Example usage for org.apache.commons.pool.impl GenericKeyedObjectPool getNumIdle

List of usage examples for org.apache.commons.pool.impl GenericKeyedObjectPool getNumIdle

Introduction

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

Prototype

public synchronized int getNumIdle() 

Source Link

Document

Returns the total number of instances currently idle in this pool.

Usage

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

public void testExceptionOnPassivateDuringReturn() throws Exception {
    SimpleFactory factory = new SimpleFactory();
    GenericKeyedObjectPool pool = new GenericKeyedObjectPool(factory);
    Object obj = pool.borrowObject("one");
    factory.setThrowExceptionOnPassivate(true);
    pool.returnObject("one", obj);
    assertEquals(0, pool.getNumIdle());
    pool.close();//from w  w  w . ja v  a  2 s  . co  m
}