1 23 24 29 30 package com.sun.enterprise.tools.common.dd.ejb; 31 32 import org.w3c.dom.*; 33 import org.netbeans.modules.schema2beans.*; 34 import java.beans.*; 35 import java.util.*; 36 37 39 public class BeanPool extends com.sun.enterprise.tools.common.dd.SunBaseBean 40 { 41 42 static Vector comparators = new Vector(); 43 44 static public final String STEADY_POOL_SIZE = "SteadyPoolSize"; static public final String RESIZE_QUANTITY = "ResizeQuantity"; static public final String MAX_POOL_SIZE = "MaxPoolSize"; static public final String POOL_IDLE_TIMEOUT_IN_SECONDS = "PoolIdleTimeoutInSeconds"; static public final String MAX_WAIT_TIME_IN_MILLIS = "MaxWaitTimeInMillis"; 50 public BeanPool() { 51 this(Common.USE_DEFAULT_VALUES); 52 } 53 54 public BeanPool(int options) 55 { 56 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 57 this.createProperty("steady-pool-size", STEADY_POOL_SIZE, 60 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 61 String .class); 62 this.createProperty("resize-quantity", RESIZE_QUANTITY, 64 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 65 String .class); 66 this.createProperty("max-pool-size", MAX_POOL_SIZE, 68 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 69 String .class); 70 this.createProperty("pool-idle-timeout-in-seconds", POOL_IDLE_TIMEOUT_IN_SECONDS, 72 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 73 String .class); 74 this.createProperty("max-wait-time-in-millis", MAX_WAIT_TIME_IN_MILLIS, 76 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 77 String .class); 78 this.initialize(options); 79 } 80 81 void initialize(int options) 83 { 84 85 } 86 87 public void setSteadyPoolSize(String value) { 89 this.setValue(STEADY_POOL_SIZE, value); 90 } 91 92 public String getSteadyPoolSize() { 94 return (String )this.getValue(STEADY_POOL_SIZE); 95 } 96 97 public void setResizeQuantity(String value) { 99 this.setValue(RESIZE_QUANTITY, value); 100 } 101 102 public String getResizeQuantity() { 104 return (String )this.getValue(RESIZE_QUANTITY); 105 } 106 107 public void setMaxPoolSize(String value) { 109 this.setValue(MAX_POOL_SIZE, value); 110 } 111 112 public String getMaxPoolSize() { 114 return (String )this.getValue(MAX_POOL_SIZE); 115 } 116 117 public void setPoolIdleTimeoutInSeconds(String value) { 119 this.setValue(POOL_IDLE_TIMEOUT_IN_SECONDS, value); 120 } 121 122 public String getPoolIdleTimeoutInSeconds() { 124 return (String )this.getValue(POOL_IDLE_TIMEOUT_IN_SECONDS); 125 } 126 127 public void setMaxWaitTimeInMillis(String value) { 129 this.setValue(MAX_WAIT_TIME_IN_MILLIS, value); 130 } 131 132 public String getMaxWaitTimeInMillis() { 134 return (String )this.getValue(MAX_WAIT_TIME_IN_MILLIS); 135 } 136 137 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 139 comparators.add(c); 140 } 141 142 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 144 comparators.remove(c); 145 } 146 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 147 boolean restrictionFailure = false; 148 if (getSteadyPoolSize() != null) { 150 } 151 if (getResizeQuantity() != null) { 153 } 154 if (getMaxPoolSize() != null) { 156 } 157 if (getPoolIdleTimeoutInSeconds() != null) { 159 } 160 if (getMaxWaitTimeInMillis() != null) { 162 } 163 } 164 165 public void dump(StringBuffer str, String indent){ 167 String s; 168 Object o; 169 org.netbeans.modules.schema2beans.BaseBean n; 170 str.append(indent); 171 str.append("SteadyPoolSize"); str.append(indent+"\t"); str.append("<"); s = this.getSteadyPoolSize(); 175 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(STEADY_POOL_SIZE, 0, str, indent); 178 179 str.append(indent); 180 str.append("ResizeQuantity"); str.append(indent+"\t"); str.append("<"); s = this.getResizeQuantity(); 184 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(RESIZE_QUANTITY, 0, str, indent); 187 188 str.append(indent); 189 str.append("MaxPoolSize"); str.append(indent+"\t"); str.append("<"); s = this.getMaxPoolSize(); 193 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(MAX_POOL_SIZE, 0, str, indent); 196 197 str.append(indent); 198 str.append("PoolIdleTimeoutInSeconds"); str.append(indent+"\t"); str.append("<"); s = this.getPoolIdleTimeoutInSeconds(); 202 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(POOL_IDLE_TIMEOUT_IN_SECONDS, 0, str, indent); 205 206 str.append(indent); 207 str.append("MaxWaitTimeInMillis"); str.append(indent+"\t"); str.append("<"); s = this.getMaxWaitTimeInMillis(); 211 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(MAX_WAIT_TIME_IN_MILLIS, 0, str, indent); 214 215 } 216 public String dumpBeanNode(){ 217 StringBuffer str = new StringBuffer (); 218 str.append("BeanPool\n"); this.dump(str, "\n "); return str.toString(); 221 }} 222 223 225 226 1070 | Popular Tags |