KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > config > serverbeans > SessionManager


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23  
24 /**
25  * This generated bean class SessionManager matches the DTD element session-manager
26  *
27  */

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 JavaDoc;
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 // BEGIN_NOI18N
42

43 public class SessionManager extends ConfigBean implements Serializable JavaDoc
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 JavaDoc MANAGER_PROPERTIES = "ManagerProperties";
50     static public final String JavaDoc 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         // Properties (see root bean comments for the bean graph)
60
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     // Setting the default values of the properties
89
void initialize(int options) {
90
91     }
92
93     // This attribute is optional
94
public void setManagerProperties(ManagerProperties value) {
95         this.setValue(MANAGER_PROPERTIES, value);
96     }
97
98     // Get Method
99
public ManagerProperties getManagerProperties() {
100         return (ManagerProperties)this.getValue(MANAGER_PROPERTIES);
101     }
102
103     // This attribute is optional
104
public void setStoreProperties(StoreProperties value) {
105         this.setValue(STORE_PROPERTIES, value);
106     }
107
108     // Get Method
109
public StoreProperties getStoreProperties() {
110         return (StoreProperties)this.getValue(STORE_PROPERTIES);
111     }
112
113     /**
114      * Create a new bean using it's default constructor.
115      * This does not add it to any bean graph.
116      */

117     public ManagerProperties newManagerProperties() {
118         return new ManagerProperties();
119     }
120
121     /**
122      * Create a new bean using it's default constructor.
123      * This does not add it to any bean graph.
124      */

125     public StoreProperties newStoreProperties() {
126         return new StoreProperties();
127     }
128
129     /**
130     * get the xpath representation for this element
131     * returns something like abc[@name='value'] or abc
132     * depending on the type of the bean
133     */

134     protected String JavaDoc getRelativeXPath() {
135         String JavaDoc ret = null;
136         ret = "session-manager";
137         return (null != ret ? ret.trim() : null);
138     }
139
140     /*
141     * generic method to get default value from dtd
142     */

143     public static String JavaDoc getDefaultAttributeValue(String JavaDoc attr) {
144         if(attr == null) return null;
145         attr = attr.trim();
146     return null;
147     }
148     //
149
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
150         comparators.add(c);
151     }
152
153     //
154
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     // Dump the content of this bean returning it as a String
161
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
162         String JavaDoc s;
163         Object JavaDoc o;
164         org.netbeans.modules.schema2beans.BaseBean n;
165         str.append(indent);
166         str.append("ManagerProperties"); // NOI18N
167
n = (org.netbeans.modules.schema2beans.BaseBean) this.getManagerProperties();
168         if (n != null)
169             n.dump(str, indent + "\t"); // NOI18N
170
else
171             str.append(indent+"\tnull"); // NOI18N
172
this.dumpAttributes(MANAGER_PROPERTIES, 0, str, indent);
173
174         str.append(indent);
175         str.append("StoreProperties"); // NOI18N
176
n = (org.netbeans.modules.schema2beans.BaseBean) this.getStoreProperties();
177         if (n != null)
178             n.dump(str, indent + "\t"); // NOI18N
179
else
180             str.append(indent+"\tnull"); // NOI18N
181
this.dumpAttributes(STORE_PROPERTIES, 0, str, indent);
182
183     }
184     public String JavaDoc dumpBeanNode(){
185         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
186         str.append("SessionManager\n"); // NOI18N
187
this.dump(str, "\n "); // NOI18N
188
return str.toString();
189     }}
190
191 // END_NOI18N
192

193
Popular Tags