Example usage for org.apache.commons.pool2.impl GenericObjectPool addObject

List of usage examples for org.apache.commons.pool2.impl GenericObjectPool addObject

Introduction

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

Prototype

@Override
public void addObject() throws Exception 

Source Link

Document

Create an object, and place it into the pool.

Usage

From source file:me.smoe.adar.pool.commonpool.CommonPool.java

private static void prestartCorePool(GenericObjectPool<?> objectPool) throws Exception {
    for (int i = 0; i < objectPool.getMaxIdle(); i++) {
        objectPool.addObject();
    }/*  w  w  w . j a  v  a2 s.c o m*/
}