package org.huihoo.jfox.pool;

/**
 * 
 * @author <a href="mailto:young_yy@hotmail.com">Young Yang</a>
 */

public class Test {

  public static void main(String[] args) throws Exception{
    ObjectPool pool = new SimpleObjectPool(ObjectFactorySupport.class.getName(),TestPoolableObject.class.getName(),10,20); // PoolManager.createPool(new ObjectFactorySupport(TestPoolableObject.class));

    pool.init();

    System.out.println("Working: " + pool.getWorking() + ", Rest: " + pool.getRest());

    TestPoolableObject tpobj= (TestPoolableObject)pool.retrieveObject();

    System.out.println("Working: " + pool.getWorking() + ", Rest: " + pool.getRest());

    System.out.println("word from pool: " + tpobj.say());

    pool.restoreObject(tpobj);

    System.out.println("Working: " + pool.getWorking() + ", Rest: " + pool.getRest());

  }

}
