1 23 24 29 30 package com.sun.enterprise.tools.common.dd.webapp; 31 32 import org.w3c.dom.*; 33 import org.netbeans.modules.schema2beans.*; 34 import java.beans.*; 35 import java.util.*; 36 37 39 public class SessionConfig extends com.sun.enterprise.tools.common.dd.SunBaseBean 40 { 41 42 static Vector comparators = new Vector(); 43 44 static public final String SESSION_MANAGER = "SessionManager"; static public final String SESSION_PROPERTIES = "SessionProperties"; static public final String COOKIE_PROPERTIES = "CookieProperties"; 48 public SessionConfig() { 49 this(Common.USE_DEFAULT_VALUES); 50 } 51 52 public SessionConfig(int options) 53 { 54 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 55 this.createProperty("session-manager", SESSION_MANAGER, 58 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 59 SessionManager.class); 60 this.createAttribute(SESSION_MANAGER, "persistence-type", "PersistenceType", 61 AttrProp.CDATA, 62 null, "memory"); 63 this.createProperty("session-properties", SESSION_PROPERTIES, 65 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 66 SessionProperties.class); 67 this.createProperty("cookie-properties", COOKIE_PROPERTIES, 69 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 70 CookieProperties.class); 71 this.initialize(options); 72 } 73 74 void initialize(int options) 76 { 77 78 } 79 80 public void setSessionManager(SessionManager value) { 82 this.setValue(SESSION_MANAGER, value); 83 } 84 85 public SessionManager getSessionManager() { 87 return (SessionManager)this.getValue(SESSION_MANAGER); 88 } 89 90 public void setSessionProperties(SessionProperties value) { 92 this.setValue(SESSION_PROPERTIES, value); 93 } 94 95 public SessionProperties getSessionProperties() { 97 return (SessionProperties)this.getValue(SESSION_PROPERTIES); 98 } 99 100 public void setCookieProperties(CookieProperties value) { 102 this.setValue(COOKIE_PROPERTIES, value); 103 } 104 105 public CookieProperties getCookieProperties() { 107 return (CookieProperties)this.getValue(COOKIE_PROPERTIES); 108 } 109 110 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 112 comparators.add(c); 113 } 114 115 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 117 comparators.remove(c); 118 } 119 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 120 boolean restrictionFailure = false; 121 if (getSessionManager() != null) { 123 getSessionManager().validate(); 124 } 125 if (getSessionProperties() != null) { 127 getSessionProperties().validate(); 128 } 129 if (getCookieProperties() != null) { 131 getCookieProperties().validate(); 132 } 133 } 134 135 public void dump(StringBuffer str, String indent){ 137 String s; 138 Object o; 139 org.netbeans.modules.schema2beans.BaseBean n; 140 str.append(indent); 141 str.append("SessionManager"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getSessionManager(); 143 if (n != null) 144 n.dump(str, indent + "\t"); else 146 str.append(indent+"\tnull"); this.dumpAttributes(SESSION_MANAGER, 0, str, indent); 148 149 str.append(indent); 150 str.append("SessionProperties"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getSessionProperties(); 152 if (n != null) 153 n.dump(str, indent + "\t"); else 155 str.append(indent+"\tnull"); this.dumpAttributes(SESSION_PROPERTIES, 0, str, indent); 157 158 str.append(indent); 159 str.append("CookieProperties"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getCookieProperties(); 161 if (n != null) 162 n.dump(str, indent + "\t"); else 164 str.append(indent+"\tnull"); this.dumpAttributes(COOKIE_PROPERTIES, 0, str, indent); 166 167 } 168 public String dumpBeanNode(){ 169 StringBuffer str = new StringBuffer (); 170 str.append("SessionConfig\n"); this.dump(str, "\n "); return str.toString(); 173 }} 174 175 177 178 645 | Popular Tags |