1 23 24 29 42 43 48 49 package com.sun.enterprise.util.pool; 50 51 63 public class UnboundedPool 64 extends ArrayListPool 65 { 66 private int initialSize; 67 68 76 public UnboundedPool(ObjectFactory factory, int initialSize) { 77 super(factory, initialSize); 78 this.initialSize = initialSize; 79 super.preload(initialSize); 80 } 81 82 86 protected boolean canCreate() { 87 return true; 88 } 89 90 98 protected Object checkin(Object object) { 99 if (waitCount == 0) { 100 int diff = arrayList.size() - initialSize; 101 if (diff > initialSize) { 102 super.destroyPoolObjects(diff); 103 } 104 } 105 106 arrayList.add(object); 107 return this; 108 } 109 110 } | Popular Tags |