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 SessionConfig 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 static public final String SESSION_MANAGER = "SessionManager"; 50 static public final String SESSION_PROPERTIES = "SessionProperties"; 51 52 public SessionConfig() { 53 this(Common.USE_DEFAULT_VALUES); 54 } 55 56 public SessionConfig(int options) 57 { 58 super(comparators, runtimeVersion); 59 initPropertyTables(2); 61 this.createProperty("session-manager", SESSION_MANAGER, 62 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 63 SessionManager.class); 64 this.createProperty("session-properties", SESSION_PROPERTIES, 65 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 66 SessionProperties.class); 67 this.createAttribute(SESSION_PROPERTIES, "timeout-in-seconds", "TimeoutInSeconds", 68 AttrProp.CDATA | AttrProp.IMPLIED, 69 null, null); 70 this.initialize(options); 71 } 72 73 void initialize(int options) { 75 76 } 77 78 public void setSessionManager(SessionManager value) { 80 this.setValue(SESSION_MANAGER, value); 81 } 82 83 public SessionManager getSessionManager() { 85 return (SessionManager)this.getValue(SESSION_MANAGER); 86 } 87 88 public void setSessionProperties(SessionProperties value) { 90 this.setValue(SESSION_PROPERTIES, value); 91 } 92 93 public SessionProperties getSessionProperties() { 95 return (SessionProperties)this.getValue(SESSION_PROPERTIES); 96 } 97 98 102 public SessionManager newSessionManager() { 103 return new SessionManager(); 104 } 105 106 110 public SessionProperties newSessionProperties() { 111 return new SessionProperties(); 112 } 113 114 119 protected String getRelativeXPath() { 120 String ret = null; 121 ret = "session-config"; 122 return (null != ret ? ret.trim() : null); 123 } 124 125 128 public static String getDefaultAttributeValue(String attr) { 129 if(attr == null) return null; 130 attr = attr.trim(); 131 return null; 132 } 133 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 135 comparators.add(c); 136 } 137 138 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 140 comparators.remove(c); 141 } 142 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 143 } 144 145 public void dump(StringBuffer str, String indent){ 147 String s; 148 Object o; 149 org.netbeans.modules.schema2beans.BaseBean n; 150 str.append(indent); 151 str.append("SessionManager"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getSessionManager(); 153 if (n != null) 154 n.dump(str, indent + "\t"); else 156 str.append(indent+"\tnull"); this.dumpAttributes(SESSION_MANAGER, 0, str, indent); 158 159 str.append(indent); 160 str.append("SessionProperties"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getSessionProperties(); 162 if (n != null) 163 n.dump(str, indent + "\t"); else 165 str.append(indent+"\tnull"); this.dumpAttributes(SESSION_PROPERTIES, 0, str, indent); 167 168 } 169 public String dumpBeanNode(){ 170 StringBuffer str = new StringBuffer (); 171 str.append("SessionConfig\n"); this.dump(str, "\n "); return str.toString(); 174 }} 175 176 178 | Popular Tags |