KickJava   Java API By Example, From Geeks To Geeks.

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


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 WebProperty matches the schema element property
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 WebProperty extends com.sun.enterprise.tools.common.dd.SunBaseBean
40 {
41
42     static Vector comparators = new Vector();
43
44     static public final String JavaDoc NAME = "Name"; // NOI18N
45
static public final String JavaDoc VALUE = "Value"; // NOI18N
46
static public final String JavaDoc DESCRIPTION = "Description"; // NOI18N
47

48     public WebProperty() {
49         this(Common.USE_DEFAULT_VALUES);
50     }
51
52     public WebProperty(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("description", // NOI18N
57
DESCRIPTION,
58             Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
59             String JavaDoc.class);
60         this.initialize(options);
61     }
62
63     // Setting the default values of the properties
64
void initialize(int options)
65     {
66             
67     }
68
69     // This attribute is mandatory
70
public void setName(java.lang.String JavaDoc value) {
71         setAttributeValue(NAME, value);
72     }
73
74     //
75
public java.lang.String JavaDoc getName() {
76         return getAttributeValue(NAME);
77     }
78
79     // This attribute is mandatory
80
public void setValue(java.lang.String JavaDoc value) {
81         setAttributeValue(VALUE, value);
82     }
83
84     //
85
public java.lang.String JavaDoc getValue() {
86         return getAttributeValue(VALUE);
87     }
88
89     // This attribute is optional
90
public void setDescription(String JavaDoc value) {
91         this.setValue(DESCRIPTION, value);
92     }
93
94     //
95
public String JavaDoc getDescription() {
96         return (String JavaDoc)this.getValue(DESCRIPTION);
97     }
98
99     //
100
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
101         comparators.add(c);
102     }
103
104     //
105
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
106         comparators.remove(c);
107     }
108     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
109         boolean restrictionFailure = false;
110         // Validating property name
111
if (getName() == null) {
112             throw new org.netbeans.modules.schema2beans.ValidateException("getName() == null", "name", this); // NOI18N
113
}
114         // Validating property value
115
if (getValue() == null) {
116             throw new org.netbeans.modules.schema2beans.ValidateException("getValue() == null", "value", this); // NOI18N
117
}
118         // Validating property description
119
if (getDescription() != null) {
120         }
121     }
122
123     // Dump the content of this bean returning it as a String
124
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
125         String JavaDoc s;
126         Object JavaDoc o;
127         org.netbeans.modules.schema2beans.BaseBean n;
128         str.append(indent);
129         str.append("Description"); // NOI18N
130
str.append(indent+"\t"); // NOI18N
131
str.append("<"); // NOI18N
132
s = this.getDescription();
133         str.append((s==null?"null":s.trim())); // NOI18N
134
str.append(">\n"); // NOI18N
135
this.dumpAttributes(DESCRIPTION, 0, str, indent);
136
137     }
138     public String JavaDoc dumpBeanNode(){
139         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
140         str.append("WebProperty\n"); // NOI18N
141
this.dump(str, "\n "); // NOI18N
142
return str.toString();
143     }}
144
145 // END_NOI18N
146

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

615
Popular Tags