KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > common > dd > webapp > SessionConfig


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 SessionConfig matches the schema element session-config
26  *
27  * Generated on Tue Sep 02 18:08:42 PDT 2003
28  */

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 // BEGIN_NOI18N
38

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 JavaDoc SESSION_MANAGER = "SessionManager"; // NOI18N
45
static public final String JavaDoc SESSION_PROPERTIES = "SessionProperties"; // NOI18N
46
static public final String JavaDoc COOKIE_PROPERTIES = "CookieProperties"; // NOI18N
47

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         // Properties (see root bean comments for the bean graph)
56
this.createProperty("session-manager", // NOI18N
57
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", // NOI18N
64
SESSION_PROPERTIES,
65             Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
66             SessionProperties.class);
67         this.createProperty("cookie-properties", // NOI18N
68
COOKIE_PROPERTIES,
69             Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
70             CookieProperties.class);
71         this.initialize(options);
72     }
73
74     // Setting the default values of the properties
75
void initialize(int options)
76     {
77
78     }
79
80     // This attribute is optional
81
public void setSessionManager(SessionManager value) {
82         this.setValue(SESSION_MANAGER, value);
83     }
84
85     //
86
public SessionManager getSessionManager() {
87         return (SessionManager)this.getValue(SESSION_MANAGER);
88     }
89
90     // This attribute is optional
91
public void setSessionProperties(SessionProperties value) {
92         this.setValue(SESSION_PROPERTIES, value);
93     }
94
95     //
96
public SessionProperties getSessionProperties() {
97         return (SessionProperties)this.getValue(SESSION_PROPERTIES);
98     }
99
100     // This attribute is optional
101
public void setCookieProperties(CookieProperties value) {
102         this.setValue(COOKIE_PROPERTIES, value);
103     }
104
105     //
106
public CookieProperties getCookieProperties() {
107         return (CookieProperties)this.getValue(COOKIE_PROPERTIES);
108     }
109
110     //
111
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
112         comparators.add(c);
113     }
114
115     //
116
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         // Validating property sessionManager
122
if (getSessionManager() != null) {
123             getSessionManager().validate();
124         }
125         // Validating property sessionProperties
126
if (getSessionProperties() != null) {
127             getSessionProperties().validate();
128         }
129         // Validating property cookieProperties
130
if (getCookieProperties() != null) {
131             getCookieProperties().validate();
132         }
133     }
134
135     // Dump the content of this bean returning it as a String
136
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
137         String JavaDoc s;
138         Object JavaDoc o;
139         org.netbeans.modules.schema2beans.BaseBean n;
140         str.append(indent);
141         str.append("SessionManager"); // NOI18N
142
n = (org.netbeans.modules.schema2beans.BaseBean) this.getSessionManager();
143         if (n != null)
144             n.dump(str, indent + "\t"); // NOI18N
145
else
146             str.append(indent+"\tnull"); // NOI18N
147
this.dumpAttributes(SESSION_MANAGER, 0, str, indent);
148
149         str.append(indent);
150         str.append("SessionProperties"); // NOI18N
151
n = (org.netbeans.modules.schema2beans.BaseBean) this.getSessionProperties();
152         if (n != null)
153             n.dump(str, indent + "\t"); // NOI18N
154
else
155             str.append(indent+"\tnull"); // NOI18N
156
this.dumpAttributes(SESSION_PROPERTIES, 0, str, indent);
157
158         str.append(indent);
159         str.append("CookieProperties"); // NOI18N
160
n = (org.netbeans.modules.schema2beans.BaseBean) this.getCookieProperties();
161         if (n != null)
162             n.dump(str, indent + "\t"); // NOI18N
163
else
164             str.append(indent+"\tnull"); // NOI18N
165
this.dumpAttributes(COOKIE_PROPERTIES, 0, str, indent);
166
167     }
168     public String JavaDoc dumpBeanNode(){
169         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
170         str.append("SessionConfig\n"); // NOI18N
171
this.dump(str, "\n "); // NOI18N
172
return str.toString();
173     }}
174
175 // END_NOI18N
176

177
178 /*
179         The following schema file has been used for generation:
180
181 <!--
182   XML DTD for Sun ONE Application Server specific Web Application
183   deployment descriptor. This is a companion DTD for web-app_2_4.xsd
184
185   $Revision: 1.3 $
186 -->
187
188 <!-- root element for vendor specific web application (module) configuration -->
189 <!ELEMENT sun-web-app (context-root?, security-role-mapping*, servlet*, session-config?,
190                        ejb-ref*, resource-ref*, resource-env-ref*, service-ref*,
191                        cache?, class-loader?,
192                        jsp-config?, locale-charset-info?, property*,
193                    message-destination*, webservice-description*)>
194
195 <!--
196  Context Root for the web application when the war file is a standalone module.
197  When the war module is part of the J2EE Application, use the application.xml
198 -->
199 <!ELEMENT context-root (#PCDATA)>
200
201 <!ELEMENT security-role-mapping (role-name, (principal-name | group-name)+)>
202 <!ELEMENT role-name (#PCDATA)>
203
204 <!ELEMENT principal-name (#PCDATA)>
205 <!ELEMENT group-name (#PCDATA)>
206
207 <!ELEMENT servlet (servlet-name, principal-name?, webservice-endpoint*)>
208
209 <!ELEMENT session-config (session-manager?, session-properties?, cookie-properties?)>
210
211 <!ELEMENT session-manager (manager-properties?, store-properties?)>
212 <!ATTLIST session-manager persistence-type CDATA "memory">
213
214 <!ELEMENT manager-properties (property*)>
215 <!ELEMENT store-properties (property*)>
216 <!ELEMENT session-properties (property*)>
217 <!ELEMENT cookie-properties (property*)>
218
219 <!ELEMENT jndi-name (#PCDATA)>
220
221 <!ELEMENT resource-env-ref (resource-env-ref-name, jndi-name)>
222 <!ELEMENT resource-env-ref-name (#PCDATA)>
223            
224 <!ELEMENT resource-ref (res-ref-name, jndi-name, default-resource-principal?)>
225 <!ELEMENT res-ref-name (#PCDATA)>
226
227 <!ELEMENT default-resource-principal ( name, password)>
228
229 <!--
230 This node holds information about a logical message destination
231 -->
232 <!ELEMENT message-destination (message-destination-name, jndi-name)>
233
234 <!--
235 This node holds the name of a logical message destination
236 -->
237 <!ELEMENT message-destination-name (#PCDATA)>
238
239 <!--
240 This text nodes holds a name string.
241 -->
242 <!ELEMENT name (#PCDATA)>
243
244 <!--
245 This element holds password text.
246 -->
247 <!ELEMENT password (#PCDATA)>
248
249
250 <!ELEMENT ejb-ref (ejb-ref-name, jndi-name)>
251 <!ELEMENT ejb-ref-name (#PCDATA)>
252
253 <!-- cache element configures the cache for web application. iAS 7.0 web container
254      supports one such cache object per application: i.e. <cache> is a sub element
255      of <ias-web-app>. A cache can have zero or more cache-mapping elements and
256      zero or more customizable cache-helper classes.
257                                                                                    
258         max-entries Maximum number of entries this cache may hold. [4096]
259         timeout-in-seconds Default timeout for the cache entries in seconds. [30]
260         enabled Is this cache enabled? [false]
261 -->
262 <!ELEMENT cache (cache-helper*, default-helper?, property*, cache-mapping*)>
263 <!ATTLIST cache max-entries CDATA "4096"
264                  timeout-in-seconds CDATA "30"
265                  enabled CDATA "false">
266
267 <!-- cache-helper specifies customizable class which implements CacheHelper interface.
268
269      name Unique name for the helper class; this is referenced in
270                               the cache-mapping elements (see below).
271                               "default" is reserved for the built-in default helper.
272      class-name Fully qualified class name of the cache-helper; this class
273                               must extend the com.sun.appserv.web.CacheHelper class.
274 -->
275 <!ELEMENT cache-helper (property*)>
276 <!ATTLIST cache-helper name CDATA #REQUIRED
277                        class-name CDATA #REQUIRED>
278
279 <!--
280 Default, built-in cache-helper properties
281 -->
282 <!ELEMENT default-helper (property*)>
283
284 <!--
285 cache-mapping element defines what to be cached, the key to be used, any other
286 constraints to be applied and a customizable cache-helper to programmatically
287 hook this information.
288 -->
289 <!ELEMENT cache-mapping ((servlet-name | url-pattern),
290                         (cache-helper-ref |
291                         (timeout?, refresh-field?, http-method*, key-field*, constraint-field*)))>
292
293 <!--
294 servlet-name element defines a named servlet to which this caching is enabled.
295 the specified name must be present in the web application deployment descriptor
296 (web.xml)
297 -->
298 <!ELEMENT servlet-name (#PCDATA)>
299
300 <!--
301 url-pattern element specifies the url pattern to which caching is to be enabled.
302 See Servlet 2.3 specification section SRV. 11.2 for the applicable patterns.
303 -->
304 <!ELEMENT url-pattern (#PCDATA)>
305
306 <!--
307 cache-helper-ref s a reference to the cache-helper used by this cache-mapping
308 -->
309 <!ELEMENT cache-helper-ref (#PCDATA)>
310
311 <!--
312 timeout element defines the cache timeout in seconds applicable for this mapping.
313 default is to use cache object's timeout. The timeout value is specified statically
314 ere (e.g. <timeout> 60 </timeout> or dynamically via fields in the relevant scope.
315
316    name Name of the field where this timeout could be found
317    scope Scope of the field. default scope is request attribute.
318 -->
319 <!ELEMENT timeout (#PCDATA)>
320 <!ATTLIST timeout name CDATA #REQUIRED
321                    scope CDATA 'request.attribute'>
322
323 <!--
324 http-method specifies HTTP method eligible for caching default is GET.
325 -->
326 <!ELEMENT http-method (#PCDATA)>
327
328 <!--
329 specifies the request parameter name that triggers refresh. the cached entry
330 is refreshed when there such a request parameter is set to "true"
331 example:
332 <cache-mapping>
333     <url-pattern> /quote </url-pattern>
334     <refresh-field name="refresh" scope="request.parameter"/>
335 </cache-mapping>
336 -->
337 <!ELEMENT refresh-field EMPTY>
338 <!ATTLIST refresh-field name CDATA #REQUIRED
339                         scope CDATA 'request.parameter'>
340 <!--
341 key-field specifies a component of the key; container looks for the named
342 field in the given scope to access the cached entry. Default is to use
343 the Servlet Path (the path section that corresponds to the servlet mapping
344 which activated this request). See Servlet 2.3 specification section SRV 4.4
345 on Servlet Path.
346
347   name Name of the field to look for in the given scope
348   scope Scope of the field. default scope is request parameter.
349 -->
350 <!ELEMENT key-field EMPTY>
351 <!ATTLIST key-field name CDATA #REQUIRED
352                     scope CDATA 'request.parameter'>
353
354 <!--
355 constraint-field specifies a field whose value is used as a cacheability constraint.
356   
357   name Name of the field to look for in the given scope
358   scope Scope of the field. Default scope is request parameter.
359   cache-on-match Should this constraint check pass, is the response cacheable?
360                            Default is true (i.e. cache the response on success match).
361                            Useful to turn off caching when there is an attribute in the
362                            scope (e.g. don't cache when there is an attribute called UID
363                            in the session.attribute scope).
364   cache-on-match-failure Should the constraint check fail, is response not cacheable?
365                            Default is false (i.e. a failure in enforcing the constraint
366                            would negate caching). Useful to turn on caching when the
367                            an an attribute is not present (e.g. turn on caching
368                            when there is no session or session attribute called UID).
369
370   Example 1: don't cache when there is a session attribute
371   <constraint-field name="UID" scope="session.attribute" cache-on-match="false">
372
373   Example 2: do cache only when there is no session attribute
374   <constraint-field name="UID" scope="session.attribute"
375                     cache-on-match-failure="false">
376 -->
377 <!ELEMENT constraint-field (constraint-field-value*)>
378 <!ATTLIST constraint-field name CDATA #REQUIRED
379                             scope CDATA 'request.parameter'
380                             cache-on-match CDATA 'true'
381                             cache-on-match-failure CDATA 'false'>
382
383 <!--
384 value element specifies the applicable value and a matching expression for a constraint-field
385   match-expr Expression used to match the value. Default is 'equals'.
386
387   Example 1: cache when the category matches with any value other than a specific value
388   <constraint-field name="category" scope="request.parameter>
389     <value match-expr="equals" cache-on-match-failure="true">
390          bogus
391     </value>
392   </constraint-field>
393 -->
394 <!ELEMENT constraint-field-value (#PCDATA)>
395 <!ATTLIST constraint-field-value match-expr CDATA 'equals'
396                             cache-on-match CDATA 'true'
397                             cache-on-match-failure CDATA 'false'>
398
399 <!ELEMENT class-loader EMPTY>
400 <!ATTLIST class-loader extra-class-path CDATA #IMPLIED
401                        delegate CDATA 'true'>
402
403 <!ELEMENT jsp-config (property*)>
404
405 <!ELEMENT locale-charset-info (locale-charset-map+, parameter-encoding?)>
406 <!ATTLIST locale-charset-info default-locale CDATA #REQUIRED>
407
408 <!ELEMENT locale-charset-map (description?)>
409 <!ATTLIST locale-charset-map locale CDATA #REQUIRED
410                              agent CDATA #IMPLIED
411                              charset CDATA #REQUIRED>
412
413 <!ELEMENT parameter-encoding EMPTY>
414 <!ATTLIST parameter-encoding form-hint-field CDATA #IMPLIED
415                  default-charset CDATA #IMPLIED>
416
417 <!--
418 Syntax for supplying properties as name value pairs
419 -->
420 <!ELEMENT property (description?)>
421 <!ATTLIST property name CDATA #REQUIRED
422                    value CDATA #REQUIRED>
423
424 <!ELEMENT description (#PCDATA)>
425
426 <!--
427 This text nodes holds a value string.
428 -->
429 <!ELEMENT value (#PCDATA)>
430
431
432 <!--
433                     W E B S E R V I C E S
434 -->
435 <!--
436 Runtime settings for a web service reference. In the simplest case,
437 there is no runtime information required for a service ref. Runtime info
438 is only needed in the following cases :
439  * to define the port that should be used to resolve a container-managed port
440  * to define default Stub/Call property settings for Stub objects
441  * to define the URL of a final WSDL document to be used instead of
442 the one packaged with a service-ref
443 -->
444 <!ELEMENT service-ref ( service-ref-name, port-info*, call-property*, wsdl-override?, service-impl-class?, service-qname? )>
445
446 <!--
447 Coded name (relative to java:comp/env) for a service-reference
448 -->
449 <!ELEMENT service-ref-name ( #PCDATA )>
450
451 <!--
452 Information for a port within a service-reference.
453
454 Either service-endpoint-interface or wsdl-port or both
455 (service-endpoint-interface and wsdl-port) should be specified.
456
457 If both are specified, wsdl-port represents the
458 port the container should choose for container-managed port selection.
459
460 The same wsdl-port value must not appear in
461 more than one port-info entry within the same service-ref.
462
463 If a particular service-endpoint-interface is using container-managed port
464 selection, it must not appear in more than one port-info entry
465 within the same service-ref.
466
467 -->
468 <!ELEMENT port-info ( service-endpoint-interface?, wsdl-port?, stub-property*, call-property* )>
469
470 <!--
471 Fully qualified name of service endpoint interface
472 -->
473 <!ELEMENT service-endpoint-interface ( #PCDATA )>
474 <!--
475 Port used in port-info.
476 -->
477 <!ELEMENT wsdl-port ( namespaceURI, localpart )>
478
479 <!--
480 JAXRPC property values that should be set on a stub before it's returned to
481 to the web service client. The property names can be any properties supported
482 by the JAXRPC Stub implementation. See javadoc for javax.xml.rpc.Stub
483 -->
484 <!ELEMENT stub-property ( name, value )>
485
486 <!--
487 JAXRPC property values that should be set on a Call object before it's
488 returned to the web service client. The property names can be any
489 properties supported by the JAXRPC Call implementation. See javadoc
490 for javax.xml.rpc.Call
491 -->
492 <!ELEMENT call-property ( name, value )>
493
494 <!--
495 This is a valid URL pointing to a final WSDL document. It is optional.
496 If specified, the WSDL document at this URL will be used during
497 deployment instead of the WSDL document associated with the
498 service-ref in the standard deployment descriptor.
499
500 Examples :
501
502   // available via HTTP
503   <wsdl-override>http://localhost:8000/myservice/myport?WSDL</wsdl-override>
504
505   // in a file
506   <wsdl-override>file:/home/user1/myfinalwsdl.wsdl</wsdl-override>
507
508 -->
509 <!ELEMENT wsdl-override ( #PCDATA )>
510
511 <!--
512 Name of generated service implementation class. This is not set by the
513 deployer. It is derived during deployment.
514 -->
515 <!ELEMENT service-impl-class ( #PCDATA )>
516
517 <!--
518 The service-qname element declares the specific WSDL service
519 element that is being refered to. It is not set by the deployer.
520 It is derived during deployment.
521 -->
522 <!ELEMENT service-qname (namespaceURI, localpart)>
523
524 <!--
525 Runtime information about a web service.
526
527 wsdl-publish-location is optionally used to specify
528 where the final wsdl and any dependent files should be stored. This location
529 resides on the file system from which deployment is initiated.
530
531 -->
532 <!ELEMENT webservice-description ( webservice-description-name, wsdl-publish-location? )>
533
534 <!--
535 Unique name of a webservice within a module
536 -->
537 <!ELEMENT webservice-description-name ( #PCDATA )>
538
539 <!--
540 file: URL of a directory to which a web-service-description's wsdl should be
541 published during deployment. Any required files will be published to this
542 directory, preserving their location relative to the module-specific
543 wsdl directory(META-INF/wsdl or WEB-INF/wsdl).
544
545 Example :
546
547   For an ejb.jar whose webservices.xml wsdl-file element contains
548     META-INF/wsdl/a/Foo.wsdl
549
550   <wsdl-publish-location>file:/home/user1/publish
551   </wsdl-publish-location>
552
553   The final wsdl will be stored in /home/user1/publish/a/Foo.wsdl
554
555 -->
556 <!ELEMENT wsdl-publish-location ( #PCDATA )>
557
558 <!--
559 Information about a web service endpoint.
560 -->
561 <!ELEMENT webservice-endpoint ( port-component-name, endpoint-address-uri?, login-config?, transport-guarantee?, service-qname?, tie-class?, servlet-impl-class? )>
562
563 <!--
564 Unique name of a port component within a module
565 -->
566 <!ELEMENT port-component-name ( #PCDATA )>
567
568 <!--
569 Relative path combined with web server root to form fully qualified
570 endpoint address for a web service endpoint. For servlet endpoints, this
571 value is relative to the servlet's web application context root. In
572 all cases, this value must be a fixed pattern(i.e. no "*" allowed).
573 If the web service endpoint is a servlet that only implements a single
574 endpoint has only one url-pattern, it is not necessary to set
575 this value since the container can derive it from web.xml.
576 -->
577 <!ELEMENT endpoint-address-uri ( #PCDATA )>
578
579 <!--
580 The name of tie implementation class for a port-component. This is
581 not specified by the deployer. It is derived during deployment.
582 -->
583 <!ELEMENT tie-class (#PCDATA)>
584
585 <!--
586 Optional authentication configuration for an EJB web service endpoint.
587 Not needed for servet web service endpoints. Their security configuration
588 is contained in the standard web application descriptor.
589 -->
590 <!ELEMENT login-config ( auth-method )>
591
592 <!--
593 The auth-method element is used to configure the authentication
594 mechanism for the web application. As a prerequisite to gaining access
595 to any web resources which are protected by an authorization
596 constraint, a user must have authenticated using the configured
597 mechanism.
598 -->
599
600 <!ELEMENT auth-method (#PCDATA)>
601
602 <!--
603 Name of application-written servlet impl class contained in deployed war.
604 This is not set by the deployer. It is derived by the container
605 during deployment.
606 -->
607 <!ELEMENT servlet-impl-class (#PCDATA)>
608
609 <!--
610 The transport-guarantee element specifies that the communication
611 between client and server should be NONE, INTEGRAL, or
612 CONFIDENTIAL. NONE means that the application does not require any
613 transport guarantees. A value of INTEGRAL means that the application
614 requires that the data sent between the client and server be sent in
615 such a way that it can't be changed in transit. CONFIDENTIAL means
616 that the application requires that the data be transmitted in a
617 fashion that prevents other entities from observing the contents of
618 the transmission. In most cases, the presence of the INTEGRAL or
619 CONFIDENTIAL flag will indicate that the use of SSL is required.
620 -->
621
622 <!ELEMENT transport-guarantee (#PCDATA)>
623
624 <!--
625 Runtime settings for a web service reference. In the simplest case,
626 there is no runtime information required for a service ref. Runtime info
627 is only needed in the following cases :
628  * to define the port that should be used to resolve a container-managed port
629  * to define default Stub/Call property settings for Stub objects
630  * to define the URL of a final WSDL document to be used instead of
631 the one packaged with a service-ref
632 -->
633
634 <!--
635 The localpart element indicates the local part of a QNAME.
636 -->
637 <!ELEMENT localpart (#PCDATA)>
638
639 <!--
640 The namespaceURI element indicates a URI.
641 -->
642 <!ELEMENT namespaceURI (#PCDATA)>
643
644 */

645
Popular Tags