| IndexedTest.java |
/* JFox, the OpenSource J2EE Application Server
*
* Copyright (C) 2002 huihoo.org
* Distributable under GNU LGPL license
* See the GNU Lesser General Public License for more details.
*/
package org.huihoo.jfox.pool;
/**
*
* @author <a href="mailto:young_yy@hotmail.com">Young Yang</a>
*/
public class IndexedTest {
public static void main(String[] args) throws Exception {
AbstractIndexedObjectPool pool = new SimpleIndexedObjectPool(new SimpleObjectFactory(TestPoolableObject.class));
pool.init();
TestPoolableObject obj = (TestPoolableObject)pool.retrieveObject("Test");
System.out.println("from PoolableObject: " + obj.say());
pool.restoreObject("Test",obj);
pool.removeObject("Test");
}
}