KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > common > dd > ResourceRef


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 ResourceRef matches the schema element resource-ref
26  *
27  * Generated on Wed Aug 13 12:12:26 PDT 2003
28  */

29
30 package com.sun.enterprise.tools.common.dd;
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 ResourceRef extends com.sun.enterprise.tools.common.dd.SunBaseBean
40 {
41
42     static Vector comparators = new Vector();
43
44     static public final String JavaDoc RES_REF_NAME = "ResRefName"; // NOI18N
45
static public final String JavaDoc JNDI_NAME = "JndiName"; // NOI18N
46
static public final String JavaDoc DEFAULT_RESOURCE_PRINCIPAL = "DefaultResourcePrincipal"; // NOI18N
47

48     public ResourceRef() {
49         this(Common.USE_DEFAULT_VALUES);
50     }
51
52     public ResourceRef(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("res-ref-name", // NOI18N
57
RES_REF_NAME,
58             Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY,
59             String JavaDoc.class);
60         this.createProperty("jndi-name", // NOI18N
61
JNDI_NAME,
62             Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY,
63             String JavaDoc.class);
64         this.createProperty("default-resource-principal", // NOI18N
65
DEFAULT_RESOURCE_PRINCIPAL,
66             Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
67             DefaultResourcePrincipal.class);
68         this.initialize(options);
69     }
70
71     // Setting the default values of the properties
72
void initialize(int options)
73     {
74         
75     }
76
77     // This attribute is mandatory
78
public void setResRefName(String JavaDoc value) {
79         this.setValue(RES_REF_NAME, value);
80     }
81
82     //
83
public String JavaDoc getResRefName() {
84         return (String JavaDoc)this.getValue(RES_REF_NAME);
85     }
86
87     // This attribute is mandatory
88
public void setJndiName(String JavaDoc value) {
89         this.setValue(JNDI_NAME, value);
90     }
91
92     //
93
public String JavaDoc getJndiName() {
94         return (String JavaDoc)this.getValue(JNDI_NAME);
95     }
96
97     // This attribute is optional
98
public void setDefaultResourcePrincipal(DefaultResourcePrincipal value) {
99         this.setValue(DEFAULT_RESOURCE_PRINCIPAL, value);
100     }
101
102     //
103
public DefaultResourcePrincipal getDefaultResourcePrincipal() {
104         return (DefaultResourcePrincipal)this.getValue(DEFAULT_RESOURCE_PRINCIPAL);
105     }
106
107     //
108
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
109         comparators.add(c);
110     }
111
112     //
113
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
114         comparators.remove(c);
115     }
116     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
117         boolean restrictionFailure = false;
118         // Validating property resRefName
119
if (getResRefName() == null) {
120             throw new org.netbeans.modules.schema2beans.ValidateException("getResRefName() == null", "resRefName", this); // NOI18N
121
}
122         // Validating property jndiName
123
if (getJndiName() == null) {
124             throw new org.netbeans.modules.schema2beans.ValidateException("getJndiName() == null", "jndiName", this); // NOI18N
125
}
126         // Validating property defaultResourcePrincipal
127
if (getDefaultResourcePrincipal() != null) {
128             getDefaultResourcePrincipal().validate();
129         }
130     }
131
132     // Dump the content of this bean returning it as a String
133
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
134         String JavaDoc s;
135         Object JavaDoc o;
136         org.netbeans.modules.schema2beans.BaseBean n;
137         str.append(indent);
138         str.append("ResRefName"); // NOI18N
139
str.append(indent+"\t"); // NOI18N
140
str.append("<"); // NOI18N
141
s = this.getResRefName();
142         str.append((s==null?"null":s.trim())); // NOI18N
143
str.append(">\n"); // NOI18N
144
this.dumpAttributes(RES_REF_NAME, 0, str, indent);
145
146         str.append(indent);
147         str.append("JndiName"); // NOI18N
148
str.append(indent+"\t"); // NOI18N
149
str.append("<"); // NOI18N
150
s = this.getJndiName();
151         str.append((s==null?"null":s.trim())); // NOI18N
152
str.append(">\n"); // NOI18N
153
this.dumpAttributes(JNDI_NAME, 0, str, indent);
154
155         str.append(indent);
156         str.append("DefaultResourcePrincipal"); // NOI18N
157
n = (org.netbeans.modules.schema2beans.BaseBean) this.getDefaultResourcePrincipal();
158         if (n != null)
159             n.dump(str, indent + "\t"); // NOI18N
160
else
161             str.append(indent+"\tnull"); // NOI18N
162
this.dumpAttributes(DEFAULT_RESOURCE_PRINCIPAL, 0, str, indent);
163
164     }
165     public String JavaDoc dumpBeanNode(){
166         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
167         str.append("ResourceRef\n"); // NOI18N
168
this.dump(str, "\n "); // NOI18N
169
return str.toString();
170     }}
171
172 // END_NOI18N
173

174
175 /*
176         The following schema file has been used for generation:
177
178 <!--
179 This is the root element which binds an ejb reference to a jndi name.
180 -->
181 <!ELEMENT ejb-ref (ejb-ref-name, jndi-name)>
182
183 <!--
184 This node holds all the runtime bindings of a resource env reference.
185 -->
186 <!ELEMENT resource-env-ref ( resource-env-ref-name, jndi-name )>
187
188 <!--
189 This node holds all the runtime bindings of a resource reference.
190 -->
191 <!ELEMENT resource-ref (res-ref-name, jndi-name, default-resource-principal?)>
192
193 <!ELEMENT default-resource-principal (name, password)>
194
195 <!ELEMENT security-role-mapping (role-name, (principal-name | group-name)+)>
196
197 <!--
198 Information about a web service endpoint.
199 -->
200 <!ELEMENT webservice-endpoint ( port-component-name, endpoint-address-uri?, login-config?, transport-guarantee?, service-qname?, tie-class?, servlet-impl-class? )>
201
202 <!--
203 Optional authentication configuration for an EJB web service endpoint.
204 Not needed for servet web service endpoints. Their security configuration
205 is contained in the standard web application descriptor.
206 -->
207 <!ELEMENT login-config ( auth-method )>
208
209 <!--
210 The service-qname element declares the specific WSDL service
211 element that is being refered to. It is not set by the deployer.
212 It is derived during deployment.
213 -->
214 <!ELEMENT service-qname (namespaceURI, localpart)>
215
216 <!--
217 Runtime information about a web service.
218 wsdl-publish-location is optionally used to specify
219 where the final wsdl and any dependent files should be stored. This location
220 resides on the file system from which deployment is initiated.
221 -->
222 <!ELEMENT webservice-description ( webservice-description-name, wsdl-publish-location? )>
223
224 <!--
225 Runtime settings for a web service reference. In the simplest case,
226 there is no runtime information required for a service ref. Runtime info
227 is only needed in the following cases :
228  * to define the port that should be used to resolve a container-managed port
229  * to define default Stub/Call property settings for Stub objects
230  * to define the URL of a final WSDL document to be used instead of
231 the one packaged with a service-ref
232 -->
233 <!ELEMENT service-ref ( service-ref-name, port-info*, call-property*, wsdl-override?, service-impl-class?, service-qname? )>
234
235 <!--
236 Information for a port within a service-reference.
237
238 Either service-endpoint-interface or wsdl-port or both
239 (service-endpoint-interface and wsdl-port) should be specified.
240
241 If both are specified, wsdl-port represents the
242 port the container should choose for container-managed port selection.
243
244 The same wsdl-port value must not appear in
245 more than one port-info entry within the same service-ref.
246
247 If a particular service-endpoint-interface is using container-managed port
248 selection, it must not appear in more than one port-info entry
249 within the same service-ref.
250 -->
251 <!ELEMENT port-info ( service-endpoint-interface?, wsdl-port?, stub-property*, call-property* )>
252
253 <!--
254 Port used in port-info.
255 -->
256 <!ELEMENT wsdl-port ( namespaceURI, localpart )>
257
258 <!--
259 JAXRPC property values that should be set on a stub before it's returned to
260 to the web service client. The property names can be any properties supported
261 by the JAXRPC Stub implementation. See javadoc for javax.xml.rpc.Stub
262 -->
263 <!ELEMENT stub-property ( name, value )>
264
265 <!--
266 JAXRPC property values that should be set on a Call object before it's
267 returned to the web service client. The property names can be any
268 properties supported by the JAXRPC Call implementation. See javadoc
269 for javax.xml.rpc.Call
270 -->
271 <!ELEMENT call-property ( name, value )>
272
273 <!--
274 This info is used only by studio plug-in;it is NOT the part of the orgianl DTD.
275 Used by plugin to store parameters needed to execute an Application client.
276 -->
277 <!ELEMENT plugin-data ( auto-generate-sql?, client-jar-path?, client-args? )>
278 <!ELEMENT auto-generate-sql (#PCDATA)>
279 <!ELEMENT client-jar-path (#PCDATA)>
280 <!ELEMENT client-args (#PCDATA)>
281
282 <!--
283 The ejb ref name locates the name of the ejb reference in the application.
284 -->
285 <!ELEMENT ejb-ref-name (#PCDATA)>
286
287 <!--
288 The text in this node is a jndi name.
289 -->
290 <!ELEMENT jndi-name (#PCDATA)>
291
292 <!--
293 The name of a resource env reference.
294 -->
295 <!ELEMENT resource-env-ref-name (#PCDATA)>
296
297 <!--
298 The name of a resource reference.
299 -->
300 <!ELEMENT res-ref-name (#PCDATA)>
301
302 <!--
303 This text nodes holds a name string.
304 -->
305 <!ELEMENT name (#PCDATA)>
306
307 <!--
308 This element holds password text.
309 -->
310 <!ELEMENT password (#PCDATA)>
311
312 <!ELEMENT role-name (#PCDATA)>
313
314 <!ELEMENT principal-name (#PCDATA)>
315
316 <!ELEMENT group-name (#PCDATA)>
317
318 <!--
319 Unique name of a port component within a module
320 -->
321 <!ELEMENT port-component-name ( #PCDATA )>
322
323 <!--
324 Relative path combined with web server root to form fully qualified
325 endpoint address for a web service endpoint. For servlet endpoints, this
326 value is relative to the servlet's web application context root. In
327 all cases, this value must be a fixed pattern(i.e. no "*" allowed).
328 If the web service endpoint is a servlet that only implements a single
329 endpoint has only one url-pattern, it is not necessary to set
330 this value since the container can derive it from web.xml.
331 -->
332 <!ELEMENT endpoint-address-uri ( #PCDATA )>
333
334 <!--
335 The namespaceURI element indicates a URI.
336 -->
337 <!ELEMENT namespaceURI (#PCDATA)>
338
339 <!--
340 The localpart element indicates the local part of a QNAME.
341 -->
342 <!ELEMENT localpart (#PCDATA)>
343
344 <!--
345 auth-method element describes the authentication method. The only supported value
346 is USERNAME_PASSWORD
347 -->
348 <!ELEMENT auth-method ( #PCDATA )>
349
350 <!--
351 Specifies that the communication between client and server should
352 be NONE, INTEGRAL, or CONFIDENTIAL. NONE means that the application
353 does not require any transport guarantees. A value of INTEGRAL means
354 that the application requires that the data sent between the client
355 and server be sent in such a way that it can't be changed in transit.
356 CONFIDENTIAL means that the application requires that the data be
357 transmitted in a fashion that prevents other entities from observing
358 the contents of the transmission. In most cases, the presence of the
359 INTEGRAL or CONFIDENTIAL flag will indicate that the use of SSL is
360 required.
361 -->
362 <!ELEMENT transport-guarantee ( #PCDATA )>
363
364 <!--
365 The name of tie implementation class for a port-component. This is
366 not specified by the deployer. It is derived during deployment.
367 -->
368 <!ELEMENT tie-class (#PCDATA)>
369
370 <!--
371 Name of application-written servlet impl class contained in deployed war.
372 This is not set by the deployer. It is derived by the container
373 during deployment.
374 -->
375 <!ELEMENT servlet-impl-class (#PCDATA)>
376
377 <!--
378 Unique name of a webservice within a module
379 -->
380 <!ELEMENT webservice-description-name ( #PCDATA )>
381
382 <!--
383 file: URL of a directory to which a web-service-description's wsdl should be
384 published during deployment. Any required files will be published to this
385 directory, preserving their location relative to the module-specific
386 wsdl directory(META-INF/wsdl or WEB-INF/wsdl).
387
388 Example :
389
390   For an ejb.jar whose webservices.xml wsdl-file element contains
391     META-INF/wsdl/a/Foo.wsdl
392
393   <wsdl-publish-location>file:/home/user1/publish
394   </wsdl-publish-location>
395
396   The final wsdl will be stored in /home/user1/publish/a/Foo.wsdl
397 -->
398 <!ELEMENT wsdl-publish-location ( #PCDATA )>
399
400 <!--
401 Coded name (relative to java:comp/env) for a service-reference
402 -->
403 <!ELEMENT service-ref-name ( #PCDATA )>
404
405 <!--
406 Fully qualified name of service endpoint interface
407 -->
408 <!ELEMENT service-endpoint-interface ( #PCDATA )>
409
410 <!--
411 This text nodes holds a value string.
412 -->
413 <!ELEMENT value (#PCDATA)>
414
415 <!--
416 This is a valid URL pointing to a final WSDL document. It is optional.
417 If specified, the WSDL document at this URL will be used during
418 deployment instead of the WSDL document associated with the
419 service-ref in the standard deployment descriptor.
420
421 Examples :
422
423   // available via HTTP
424   <wsdl-override>http://localhost:8000/myservice/myport?WSDL</wsdl-override>
425
426   // in a file
427   <wsdl-override>file:/home/user1/myfinalwsdl.wsdl</wsdl-override>
428 -->
429 <!ELEMENT wsdl-override ( #PCDATA )>
430
431 <!--
432 Name of generated service implementation class. This is not set by the
433 deployer. It is derived during deployment.
434 -->
435 <!ELEMENT service-impl-class ( #PCDATA )>
436
437 <!--
438 This node holds information about a logical message destination
439 -->
440 <!ELEMENT message-destination (message-destination-name, jndi-name)>
441
442 <!--
443 This node holds the name of a logical message destination
444 -->
445 <!ELEMENT message-destination-name (#PCDATA)>
446
447 */

448
Popular Tags