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 SessionManager 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 MANAGER_PROPERTIES = "ManagerProperties"; 50 static public final String STORE_PROPERTIES = "StoreProperties"; 51 52 public SessionManager() { 53 this(Common.USE_DEFAULT_VALUES); 54 } 55 56 public SessionManager(int options) 57 { 58 super(comparators, runtimeVersion); 59 initPropertyTables(2); 61 this.createProperty("manager-properties", MANAGER_PROPERTIES, 62 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 63 ManagerProperties.class); 64 this.createAttribute(MANAGER_PROPERTIES, "session-file-name", "SessionFileName", 65 AttrProp.CDATA | AttrProp.IMPLIED, 66 null, null); 67 this.createAttribute(MANAGER_PROPERTIES, "reap-interval-in-seconds", "ReapIntervalInSeconds", 68 AttrProp.CDATA | AttrProp.IMPLIED, 69 null, null); 70 this.createAttribute(MANAGER_PROPERTIES, "max-sessions", "MaxSessions", 71 AttrProp.CDATA | AttrProp.IMPLIED, 72 null, null); 73 this.createAttribute(MANAGER_PROPERTIES, "session-id-generator-classname", "SessionIdGeneratorClassname", 74 AttrProp.CDATA | AttrProp.IMPLIED, 75 null, null); 76 this.createProperty("store-properties", STORE_PROPERTIES, 77 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 78 StoreProperties.class); 79 this.createAttribute(STORE_PROPERTIES, "directory", "Directory", 80 AttrProp.CDATA | AttrProp.IMPLIED, 81 null, null); 82 this.createAttribute(STORE_PROPERTIES, "reap-interval-in-seconds", "ReapIntervalInSeconds", 83 AttrProp.CDATA | AttrProp.IMPLIED, 84 null, null); 85 this.initialize(options); 86 } 87 88 void initialize(int options) { 90 91 } 92 93 public void setManagerProperties(ManagerProperties value) { 95 this.setValue(MANAGER_PROPERTIES, value); 96 } 97 98 public ManagerProperties getManagerProperties() { 100 return (ManagerProperties)this.getValue(MANAGER_PROPERTIES); 101 } 102 103 public void setStoreProperties(StoreProperties value) { 105 this.setValue(STORE_PROPERTIES, value); 106 } 107 108 public StoreProperties getStoreProperties() { 110 return (StoreProperties)this.getValue(STORE_PROPERTIES); 111 } 112 113 117 public ManagerProperties newManagerProperties() { 118 return new ManagerProperties(); 119 } 120 121 125 public StoreProperties newStoreProperties() { 126 return new StoreProperties(); 127 } 128 129 134 protected String getRelativeXPath() { 135 String ret = null; 136 ret = "session-manager"; 137 return (null != ret ? ret.trim() : null); 138 } 139 140 143 public static String getDefaultAttributeValue(String attr) { 144 if(attr == null) return null; 145 attr = attr.trim(); 146 return null; 147 } 148 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 150 comparators.add(c); 151 } 152 153 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 155 comparators.remove(c); 156 } 157 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 158 } 159 160 public void dump(StringBuffer str, String indent){ 162 String s; 163 Object o; 164 org.netbeans.modules.schema2beans.BaseBean n; 165 str.append(indent); 166 str.append("ManagerProperties"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getManagerProperties(); 168 if (n != null) 169 n.dump(str, indent + "\t"); else 171 str.append(indent+"\tnull"); this.dumpAttributes(MANAGER_PROPERTIES, 0, str, indent); 173 174 str.append(indent); 175 str.append("StoreProperties"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getStoreProperties(); 177 if (n != null) 178 n.dump(str, indent + "\t"); else 180 str.append(indent+"\tnull"); this.dumpAttributes(STORE_PROPERTIES, 0, str, indent); 182 183 } 184 public String dumpBeanNode(){ 185 StringBuffer str = new StringBuffer (); 186 str.append("SessionManager\n"); this.dump(str, "\n "); return str.toString(); 189 }} 190 191 193 | Popular Tags |