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 RequestProcessing 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 RequestProcessing() { 51 this(Common.USE_DEFAULT_VALUES); 52 } 53 54 public RequestProcessing(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 getThreadCount() { 72 return getAttributeValue(ServerTags.THREAD_COUNT); 73 } 74 79 public void setThreadCount(String v, boolean overwrite) throws StaleWriteConfigException { 80 setAttributeValue(ServerTags.THREAD_COUNT, v, overwrite); 81 } 82 86 public void setThreadCount(String v) { 87 setAttributeValue(ServerTags.THREAD_COUNT, v); 88 } 89 92 public static String getDefaultThreadCount() { 93 return "128".trim(); 94 } 95 99 public String getInitialThreadCount() { 100 return getAttributeValue(ServerTags.INITIAL_THREAD_COUNT); 101 } 102 107 public void setInitialThreadCount(String v, boolean overwrite) throws StaleWriteConfigException { 108 setAttributeValue(ServerTags.INITIAL_THREAD_COUNT, v, overwrite); 109 } 110 114 public void setInitialThreadCount(String v) { 115 setAttributeValue(ServerTags.INITIAL_THREAD_COUNT, v); 116 } 117 120 public static String getDefaultInitialThreadCount() { 121 return "48".trim(); 122 } 123 127 public String getThreadIncrement() { 128 return getAttributeValue(ServerTags.THREAD_INCREMENT); 129 } 130 135 public void setThreadIncrement(String v, boolean overwrite) throws StaleWriteConfigException { 136 setAttributeValue(ServerTags.THREAD_INCREMENT, v, overwrite); 137 } 138 142 public void setThreadIncrement(String v) { 143 setAttributeValue(ServerTags.THREAD_INCREMENT, v); 144 } 145 148 public static String getDefaultThreadIncrement() { 149 return "10".trim(); 150 } 151 155 public String getRequestTimeoutInSeconds() { 156 return getAttributeValue(ServerTags.REQUEST_TIMEOUT_IN_SECONDS); 157 } 158 163 public void setRequestTimeoutInSeconds(String v, boolean overwrite) throws StaleWriteConfigException { 164 setAttributeValue(ServerTags.REQUEST_TIMEOUT_IN_SECONDS, v, overwrite); 165 } 166 170 public void setRequestTimeoutInSeconds(String v) { 171 setAttributeValue(ServerTags.REQUEST_TIMEOUT_IN_SECONDS, v); 172 } 173 176 public static String getDefaultRequestTimeoutInSeconds() { 177 return "30".trim(); 178 } 179 183 public String getHeaderBufferLengthInBytes() { 184 return getAttributeValue(ServerTags.HEADER_BUFFER_LENGTH_IN_BYTES); 185 } 186 191 public void setHeaderBufferLengthInBytes(String v, boolean overwrite) throws StaleWriteConfigException { 192 setAttributeValue(ServerTags.HEADER_BUFFER_LENGTH_IN_BYTES, v, overwrite); 193 } 194 198 public void setHeaderBufferLengthInBytes(String v) { 199 setAttributeValue(ServerTags.HEADER_BUFFER_LENGTH_IN_BYTES, v); 200 } 201 204 public static String getDefaultHeaderBufferLengthInBytes() { 205 return "4096".trim(); 206 } 207 212 protected String getRelativeXPath() { 213 String ret = null; 214 ret = "request-processing"; 215 return (null != ret ? ret.trim() : null); 216 } 217 218 221 public static String getDefaultAttributeValue(String attr) { 222 if(attr == null) return null; 223 attr = attr.trim(); 224 if(attr.equals(ServerTags.THREAD_COUNT)) return "128".trim(); 225 if(attr.equals(ServerTags.INITIAL_THREAD_COUNT)) return "48".trim(); 226 if(attr.equals(ServerTags.THREAD_INCREMENT)) return "10".trim(); 227 if(attr.equals(ServerTags.REQUEST_TIMEOUT_IN_SECONDS)) return "30".trim(); 228 if(attr.equals(ServerTags.HEADER_BUFFER_LENGTH_IN_BYTES)) return "4096".trim(); 229 return null; 230 } 231 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 233 comparators.add(c); 234 } 235 236 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 238 comparators.remove(c); 239 } 240 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 241 } 242 243 public void dump(StringBuffer str, String indent){ 245 String s; 246 Object o; 247 org.netbeans.modules.schema2beans.BaseBean n; 248 } 249 public String dumpBeanNode(){ 250 StringBuffer str = new StringBuffer (); 251 str.append("RequestProcessing\n"); this.dump(str, "\n "); return str.toString(); 254 }} 255 256 258 | Popular Tags |