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 KeepAlive 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 KeepAlive() { 51 this(Common.USE_DEFAULT_VALUES); 52 } 53 54 public KeepAlive(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 "1".trim(); 94 } 95 99 public String getMaxConnections() { 100 return getAttributeValue(ServerTags.MAX_CONNECTIONS); 101 } 102 107 public void setMaxConnections(String v, boolean overwrite) throws StaleWriteConfigException { 108 setAttributeValue(ServerTags.MAX_CONNECTIONS, v, overwrite); 109 } 110 114 public void setMaxConnections(String v) { 115 setAttributeValue(ServerTags.MAX_CONNECTIONS, v); 116 } 117 120 public static String getDefaultMaxConnections() { 121 return "256".trim(); 122 } 123 127 public String getTimeoutInSeconds() { 128 return getAttributeValue(ServerTags.TIMEOUT_IN_SECONDS); 129 } 130 135 public void setTimeoutInSeconds(String v, boolean overwrite) throws StaleWriteConfigException { 136 setAttributeValue(ServerTags.TIMEOUT_IN_SECONDS, v, overwrite); 137 } 138 142 public void setTimeoutInSeconds(String v) { 143 setAttributeValue(ServerTags.TIMEOUT_IN_SECONDS, v); 144 } 145 148 public static String getDefaultTimeoutInSeconds() { 149 return "30".trim(); 150 } 151 156 protected String getRelativeXPath() { 157 String ret = null; 158 ret = "keep-alive"; 159 return (null != ret ? ret.trim() : null); 160 } 161 162 165 public static String getDefaultAttributeValue(String attr) { 166 if(attr == null) return null; 167 attr = attr.trim(); 168 if(attr.equals(ServerTags.THREAD_COUNT)) return "1".trim(); 169 if(attr.equals(ServerTags.MAX_CONNECTIONS)) return "256".trim(); 170 if(attr.equals(ServerTags.TIMEOUT_IN_SECONDS)) return "30".trim(); 171 return null; 172 } 173 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 175 comparators.add(c); 176 } 177 178 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 180 comparators.remove(c); 181 } 182 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 183 } 184 185 public void dump(StringBuffer str, String indent){ 187 String s; 188 Object o; 189 org.netbeans.modules.schema2beans.BaseBean n; 190 } 191 public String dumpBeanNode(){ 192 StringBuffer str = new StringBuffer (); 193 str.append("KeepAlive\n"); this.dump(str, "\n "); return str.toString(); 196 }} 197 198 200 | Popular Tags |