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 ApplicationRef 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 ApplicationRef() { 51 this(Common.USE_DEFAULT_VALUES); 52 } 53 54 public ApplicationRef(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 boolean isEnabled() { 72 return toBoolean(getAttributeValue(ServerTags.ENABLED)); 73 } 74 79 public void setEnabled(boolean v, boolean overwrite) throws StaleWriteConfigException { 80 setAttributeValue(ServerTags.ENABLED, ""+(v==true), overwrite); 81 } 82 86 public void setEnabled(boolean v) { 87 setAttributeValue(ServerTags.ENABLED, ""+(v==true)); 88 } 89 92 public static String getDefaultEnabled() { 93 return "true".trim(); 94 } 95 99 public String getVirtualServers() { 100 return getAttributeValue(ServerTags.VIRTUAL_SERVERS); 101 } 102 107 public void setVirtualServers(String v, boolean overwrite) throws StaleWriteConfigException { 108 setAttributeValue(ServerTags.VIRTUAL_SERVERS, v, overwrite); 109 } 110 114 public void setVirtualServers(String v) { 115 setAttributeValue(ServerTags.VIRTUAL_SERVERS, v); 116 } 117 121 public boolean isLbEnabled() { 122 return toBoolean(getAttributeValue(ServerTags.LB_ENABLED)); 123 } 124 129 public void setLbEnabled(boolean v, boolean overwrite) throws StaleWriteConfigException { 130 setAttributeValue(ServerTags.LB_ENABLED, ""+(v==true), overwrite); 131 } 132 136 public void setLbEnabled(boolean v) { 137 setAttributeValue(ServerTags.LB_ENABLED, ""+(v==true)); 138 } 139 142 public static String getDefaultLbEnabled() { 143 return "false".trim(); 144 } 145 149 public String getDisableTimeoutInMinutes() { 150 return getAttributeValue(ServerTags.DISABLE_TIMEOUT_IN_MINUTES); 151 } 152 157 public void setDisableTimeoutInMinutes(String v, boolean overwrite) throws StaleWriteConfigException { 158 setAttributeValue(ServerTags.DISABLE_TIMEOUT_IN_MINUTES, v, overwrite); 159 } 160 164 public void setDisableTimeoutInMinutes(String v) { 165 setAttributeValue(ServerTags.DISABLE_TIMEOUT_IN_MINUTES, v); 166 } 167 170 public static String getDefaultDisableTimeoutInMinutes() { 171 return "30".trim(); 172 } 173 177 public String getRef() { 178 return getAttributeValue(ServerTags.REF); 179 } 180 185 public void setRef(String v, boolean overwrite) throws StaleWriteConfigException { 186 setAttributeValue(ServerTags.REF, v, overwrite); 187 } 188 192 public void setRef(String v) { 193 setAttributeValue(ServerTags.REF, v); 194 } 195 200 protected String getRelativeXPath() { 201 String ret = null; 202 ret = "application-ref" + (canHaveSiblings() ? "[@ref='" + getAttributeValue("ref") +"']" : "") ; 203 return (null != ret ? ret.trim() : null); 204 } 205 206 209 public static String getDefaultAttributeValue(String attr) { 210 if(attr == null) return null; 211 attr = attr.trim(); 212 if(attr.equals(ServerTags.ENABLED)) return "true".trim(); 213 if(attr.equals(ServerTags.LB_ENABLED)) return "false".trim(); 214 if(attr.equals(ServerTags.DISABLE_TIMEOUT_IN_MINUTES)) return "30".trim(); 215 return null; 216 } 217 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 219 comparators.add(c); 220 } 221 222 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 224 comparators.remove(c); 225 } 226 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 227 } 228 229 public void dump(StringBuffer str, String indent){ 231 String s; 232 Object o; 233 org.netbeans.modules.schema2beans.BaseBean n; 234 } 235 public String dumpBeanNode(){ 236 StringBuffer str = new StringBuffer (); 237 str.append("ApplicationRef\n"); this.dump(str, "\n "); return str.toString(); 240 }} 241 242 244 | Popular Tags |