1 23 24 28 29 package com.sun.enterprise.config.serverbeans; 30 31 import org.w3c.dom.*; 32 import org.netbeans.modules.schema2beans.*; 33 import java.beans.*; 34 import java.util.*; 35 import java.io.Serializable ; 36 import com.sun.enterprise.config.ConfigBean; 37 import com.sun.enterprise.config.ConfigException; 38 import com.sun.enterprise.config.StaleWriteConfigException; 39 import com.sun.enterprise.util.i18n.StringManager; 40 41 43 public class ConnectionPool extends ConfigBean implements Serializable 44 { 45 46 static Vector comparators = new Vector(); 47 private static final org.netbeans.modules.schema2beans.Version runtimeVersion = new org.netbeans.modules.schema2beans.Version(4, 2, 0); 48 49 50 public ConnectionPool() { 51 this(Common.USE_DEFAULT_VALUES); 52 } 53 54 public ConnectionPool(int options) 55 { 56 super(comparators, runtimeVersion); 57 initPropertyTables(0); 59 this.initialize(options); 60 } 61 62 void initialize(int options) { 64 65 } 66 67 71 public String getQueueSizeInBytes() { 72 return getAttributeValue(ServerTags.QUEUE_SIZE_IN_BYTES); 73 } 74 79 public void setQueueSizeInBytes(String v, boolean overwrite) throws StaleWriteConfigException { 80 setAttributeValue(ServerTags.QUEUE_SIZE_IN_BYTES, v, overwrite); 81 } 82 86 public void setQueueSizeInBytes(String v) { 87 setAttributeValue(ServerTags.QUEUE_SIZE_IN_BYTES, v); 88 } 89 92 public static String getDefaultQueueSizeInBytes() { 93 return "4096".trim(); 94 } 95 99 public String getMaxPendingCount() { 100 return getAttributeValue(ServerTags.MAX_PENDING_COUNT); 101 } 102 107 public void setMaxPendingCount(String v, boolean overwrite) throws StaleWriteConfigException { 108 setAttributeValue(ServerTags.MAX_PENDING_COUNT, v, overwrite); 109 } 110 114 public void setMaxPendingCount(String v) { 115 setAttributeValue(ServerTags.MAX_PENDING_COUNT, v); 116 } 117 120 public static String getDefaultMaxPendingCount() { 121 return "4096".trim(); 122 } 123 127 public String getReceiveBufferSizeInBytes() { 128 return getAttributeValue(ServerTags.RECEIVE_BUFFER_SIZE_IN_BYTES); 129 } 130 135 public void setReceiveBufferSizeInBytes(String v, boolean overwrite) throws StaleWriteConfigException { 136 setAttributeValue(ServerTags.RECEIVE_BUFFER_SIZE_IN_BYTES, v, overwrite); 137 } 138 142 public void setReceiveBufferSizeInBytes(String v) { 143 setAttributeValue(ServerTags.RECEIVE_BUFFER_SIZE_IN_BYTES, v); 144 } 145 148 public static String getDefaultReceiveBufferSizeInBytes() { 149 return "4096".trim(); 150 } 151 155 public String getSendBufferSizeInBytes() { 156 return getAttributeValue(ServerTags.SEND_BUFFER_SIZE_IN_BYTES); 157 } 158 163 public void setSendBufferSizeInBytes(String v, boolean overwrite) throws StaleWriteConfigException { 164 setAttributeValue(ServerTags.SEND_BUFFER_SIZE_IN_BYTES, v, overwrite); 165 } 166 170 public void setSendBufferSizeInBytes(String v) { 171 setAttributeValue(ServerTags.SEND_BUFFER_SIZE_IN_BYTES, v); 172 } 173 176 public static String getDefaultSendBufferSizeInBytes() { 177 return "8192".trim(); 178 } 179 184 protected String getRelativeXPath() { 185 String ret = null; 186 ret = "connection-pool"; 187 return (null != ret ? ret.trim() : null); 188 } 189 190 193 public static String getDefaultAttributeValue(String attr) { 194 if(attr == null) return null; 195 attr = attr.trim(); 196 if(attr.equals(ServerTags.QUEUE_SIZE_IN_BYTES)) return "4096".trim(); 197 if(attr.equals(ServerTags.MAX_PENDING_COUNT)) return "4096".trim(); 198 if(attr.equals(ServerTags.RECEIVE_BUFFER_SIZE_IN_BYTES)) return "4096".trim(); 199 if(attr.equals(ServerTags.SEND_BUFFER_SIZE_IN_BYTES)) return "8192".trim(); 200 return null; 201 } 202 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 204 comparators.add(c); 205 } 206 207 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 209 comparators.remove(c); 210 } 211 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 212 } 213 214 public void dump(StringBuffer str, String indent){ 216 String s; 217 Object o; 218 org.netbeans.modules.schema2beans.BaseBean n; 219 } 220 public String dumpBeanNode(){ 221 StringBuffer str = new StringBuffer (); 222 str.append("ConnectionPool\n"); this.dump(str, "\n "); return str.toString(); 225 }} 226 227 229 | Popular Tags |