Your preferences have been saved!
» Soft Reference Object Pool Demo - import junit.framework.TestCase; import junit.framework.TestSuite; import org.apache.commons.pool.PoolableObjectFactory; import org.apache.commons.pool.impl.SoftReferenceObjectPool; import java.util.HashMap; import java.lang.ref.SoftReference; public class TestSoftRef extends TestCase {   private SoftReferenceObjectPool pool;   public static TestSuite suite() {     return new TestSuite(TestSoftRef.class);... 16 Feb 12 » Test Redundant Object Pool - import java.util.HashMap; import org.apache.commons.pool.impl.SoftReferenceObjectPool; public class TestRedundantObjectPool {   public static void main(String args[]) throws Exception {     SoftReferenceObjectPool pool =       new SoftReferenceObjectPool(new EmployeeFactory(), 5);     try{       System.err.println("Number of employees in pool: " + pool.getNumIdle());       Employee employee = (Employee)pool.borrowObject();       System.err.println("Borrowed Employee: " + employee);... 16 Feb 12 » Test Object Pool - import org.apache.commons.pool.impl.GenericObjectPool; public class TestObjectPool {   public static void main(String args[]) throws Exception {     GenericObjectPool pool = new GenericObjectPool();     pool.setFactory(new EmployeeFactory());     /*First way of initializing pool     pool.setMinIdle(5);     pool.setTimeBetweenEvictionRunsMillis(500);     Thread.currentThread().sleep(600);*/     /* second, and preferred way */... 16 Feb 12 » Keyed Object Pool - import org.apache.commons.pool.impl.GenericKeyedObjectPool; public class TestKeyedObjectPool {   public static void main(String args[]) throws Exception {     GenericKeyedObjectPool pool = new GenericKeyedObjectPool();     pool.setFactory(new SkilledEmployeeFactory());     pool.addObject("Java");     pool.addObject("Java");     pool.addObject("VB");     pool.addObject("C++");     System.err.println("Number of Java employees in pool: " +... 16 Feb 12