KickJava   Java API By Example, From Geeks To Geeks.

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


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 ServiceRef matches the schema element service-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 ServiceRef extends com.sun.enterprise.tools.common.dd.SunBaseBean
40 {
41
42     static Vector comparators = new Vector();
43
44     static public final String JavaDoc SERVICE_REF_NAME = "ServiceRefName"; // NOI18N
45
static public final String JavaDoc PORT_INFO = "PortInfo"; // NOI18N
46
static public final String JavaDoc CALL_PROPERTY = "CallProperty"; // NOI18N
47
static public final String JavaDoc WSDL_OVERRIDE = "WsdlOverride"; // NOI18N
48
static public final String JavaDoc SERVICE_IMPL_CLASS = "ServiceImplClass"; // NOI18N
49
static public final String JavaDoc SERVICE_QNAME = "ServiceQname"; // NOI18N
50

51     public ServiceRef() {
52         this(Common.USE_DEFAULT_VALUES);
53     }
54
55     public ServiceRef(int options)
56     {
57         super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
58         // Properties (see root bean comments for the bean graph)
59
this.createProperty("service-ref-name", // NOI18N
60
SERVICE_REF_NAME,
61             Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY,
62             String JavaDoc.class);
63         this.createProperty("port-info", // NOI18N
64
PORT_INFO,
65             Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
66             PortInfo.class);
67         this.createProperty("call-property", // NOI18N
68
CALL_PROPERTY,
69             Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
70             CallProperty.class);
71         this.createProperty("wsdl-override", // NOI18N
72
WSDL_OVERRIDE,
73             Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
74             String JavaDoc.class);
75         this.createProperty("service-impl-class", // NOI18N
76
SERVICE_IMPL_CLASS,
77             Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
78             String JavaDoc.class);
79         this.createProperty("service-qname", // NOI18N
80
SERVICE_QNAME,
81             Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
82             ServiceQname.class);
83         this.initialize(options);
84     }
85
86     // Setting the default values of the properties
87
void initialize(int options)
88     {
89             
90     }
91
92     // This attribute is mandatory
93
public void setServiceRefName(String JavaDoc value) {
94         this.setValue(SERVICE_REF_NAME, value);
95     }
96
97     //
98
public String JavaDoc getServiceRefName() {
99         return (String JavaDoc)this.getValue(SERVICE_REF_NAME);
100     }
101
102     // This attribute is an array, possibly empty
103
public void setPortInfo(int index, PortInfo value) {
104         this.setValue(PORT_INFO, index, value);
105     }
106
107     //
108
public PortInfo getPortInfo(int index) {
109         return (PortInfo)this.getValue(PORT_INFO, index);
110     }
111
112     // This attribute is an array, possibly empty
113
public void setPortInfo(PortInfo[] value) {
114         this.setValue(PORT_INFO, value);
115     }
116
117     //
118
public PortInfo[] getPortInfo() {
119         return (PortInfo[])this.getValues(PORT_INFO);
120     }
121
122     // Return the number of properties
123
public int sizePortInfo() {
124         return this.size(PORT_INFO);
125     }
126
127     // Add a new element returning its index in the list
128
public int addPortInfo(com.sun.enterprise.tools.common.dd.PortInfo value) {
129         return this.addValue(PORT_INFO, value);
130     }
131
132     //
133
// Remove an element using its reference
134
// Returns the index the element had in the list
135
//
136
public int removePortInfo(com.sun.enterprise.tools.common.dd.PortInfo value) {
137         return this.removeValue(PORT_INFO, value);
138     }
139
140     // This attribute is an array, possibly empty
141
public void setCallProperty(int index, CallProperty value) {
142         this.setValue(CALL_PROPERTY, index, value);
143     }
144
145     //
146
public CallProperty getCallProperty(int index) {
147         return (CallProperty)this.getValue(CALL_PROPERTY, index);
148     }
149
150     // This attribute is an array, possibly empty
151
public void setCallProperty(CallProperty[] value) {
152         this.setValue(CALL_PROPERTY, value);
153     }
154
155     //
156
public CallProperty[] getCallProperty() {
157         return (CallProperty[])this.getValues(CALL_PROPERTY);
158     }
159
160     // Return the number of properties
161
public int sizeCallProperty() {
162         return this.size(CALL_PROPERTY);
163     }
164
165     // Add a new element returning its index in the list
166
public int addCallProperty(com.sun.enterprise.tools.common.dd.CallProperty value) {
167         return this.addValue(CALL_PROPERTY, value);
168     }
169
170     //
171
// Remove an element using its reference
172
// Returns the index the element had in the list
173
//
174
public int removeCallProperty(com.sun.enterprise.tools.common.dd.CallProperty value) {
175         return this.removeValue(CALL_PROPERTY, value);
176     }
177
178     // This attribute is optional
179
public void setWsdlOverride(String JavaDoc value) {
180         this.setValue(WSDL_OVERRIDE, value);
181     }
182
183     //
184
public String JavaDoc getWsdlOverride() {
185         return (String JavaDoc)this.getValue(WSDL_OVERRIDE);
186     }
187
188     // This attribute is optional
189
public void setServiceImplClass(String JavaDoc value) {
190         this.setValue(SERVICE_IMPL_CLASS, value);
191     }
192
193     //
194
public String JavaDoc getServiceImplClass() {
195         return (String JavaDoc)this.getValue(SERVICE_IMPL_CLASS);
196     }
197
198     // This attribute is optional
199
public void setServiceQname(ServiceQname value) {
200         this.setValue(SERVICE_QNAME, value);
201     }
202
203     //
204
public ServiceQname getServiceQname() {
205         return (ServiceQname)this.getValue(SERVICE_QNAME);
206     }
207
208     //
209
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
210         comparators.add(c);
211     }
212
213     //
214
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
215         comparators.remove(c);
216     }
217     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
218         boolean restrictionFailure = false;
219         // Validating property serviceRefName
220
if (getServiceRefName() == null) {
221             throw new org.netbeans.modules.schema2beans.ValidateException("getServiceRefName() == null", "serviceRefName", this); // NOI18N
222
}
223         // Validating property portInfo
224
for (int _index = 0; _index < sizePortInfo(); ++_index) {
225             com.sun.enterprise.tools.common.dd.PortInfo element = getPortInfo(_index);
226             if (element != null) {
227                 element.validate();
228             }
229         }
230         // Validating property callProperty
231
for (int _index = 0; _index < sizeCallProperty(); ++_index) {
232             com.sun.enterprise.tools.common.dd.CallProperty element = getCallProperty(_index);
233             if (element != null) {
234                 element.validate();
235             }
236         }
237         // Validating property wsdlOverride
238
if (getWsdlOverride() != null) {
239         }
240         // Validating property serviceImplClass
241
if (getServiceImplClass() != null) {
242         }
243         // Validating property serviceQname
244
if (getServiceQname() != null) {
245             getServiceQname().validate();
246         }
247     }
248
249     // Dump the content of this bean returning it as a String
250
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
251         String JavaDoc s;
252         Object JavaDoc o;
253         org.netbeans.modules.schema2beans.BaseBean n;
254         str.append(indent);
255         str.append("ServiceRefName"); // NOI18N
256
str.append(indent+"\t"); // NOI18N
257
str.append("<"); // NOI18N
258
s = this.getServiceRefName();
259         str.append((s==null?"null":s.trim())); // NOI18N
260
str.append(">\n"); // NOI18N
261
this.dumpAttributes(SERVICE_REF_NAME, 0, str, indent);
262
263         str.append(indent);
264         str.append("PortInfo["+this.sizePortInfo()+"]"); // NOI18N
265
for(int i=0; i<this.sizePortInfo(); i++)
266         {
267             str.append(indent+"\t");
268             str.append("#"+i+":");
269             n = (org.netbeans.modules.schema2beans.BaseBean) this.getPortInfo(i);
270             if (n != null)
271                 n.dump(str, indent + "\t"); // NOI18N
272
else
273                 str.append(indent+"\tnull"); // NOI18N
274
this.dumpAttributes(PORT_INFO, i, str, indent);
275         }
276
277         str.append(indent);
278         str.append("CallProperty["+this.sizeCallProperty()+"]"); // NOI18N
279
for(int i=0; i<this.sizeCallProperty(); i++)
280         {
281             str.append(indent+"\t");
282             str.append("#"+i+":");
283             n = (org.netbeans.modules.schema2beans.BaseBean) this.getCallProperty(i);
284             if (n != null)
285                 n.dump(str, indent + "\t"); // NOI18N
286
else
287                 str.append(indent+"\tnull"); // NOI18N
288
this.dumpAttributes(CALL_PROPERTY, i, str, indent);
289         }
290
291         str.append(indent);
292         str.append("WsdlOverride"); // NOI18N
293
str.append(indent+"\t"); // NOI18N
294
str.append("<"); // NOI18N
295
s = this.getWsdlOverride();
296         str.append((s==null?"null":s.trim())); // NOI18N
297
str.append(">\n"); // NOI18N
298
this.dumpAttributes(WSDL_OVERRIDE, 0, str, indent);
299
300         str.append(indent);
301         str.append("ServiceImplClass"); // NOI18N
302
str.append(indent+"\t"); // NOI18N
303
str.append("<"); // NOI18N
304
s = this.getServiceImplClass();
305         str.append((s==null?"null":s.trim())); // NOI18N
306
str.append(">\n"); // NOI18N
307
this.dumpAttributes(SERVICE_IMPL_CLASS, 0, str, indent);
308
309         str.append(indent);
310         str.append("ServiceQname"); // NOI18N
311
n = (org.netbeans.modules.schema2beans.BaseBean) this.getServiceQname();
312         if (n != null)
313             n.dump(str, indent + "\t"); // NOI18N
314
else
315             str.append(indent+"\tnull"); // NOI18N
316
this.dumpAttributes(SERVICE_QNAME, 0, str, indent);
317
318     }
319     public String JavaDoc dumpBeanNode(){
320         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
321         str.append("ServiceRef\n"); // NOI18N
322
this.dump(str, "\n "); // NOI18N
323
return str.toString();
324     }}
325
326 // END_NOI18N
327

328
329 /*
330         The following schema file has been used for generation:
331
332 <!--
333 This is the root element which binds an ejb reference to a jndi name.
334 -->
335 <!ELEMENT ejb-ref (ejb-ref-name, jndi-name)>
336
337 <!--
338 This node holds all the runtime bindings of a resource env reference.
339 -->
340 <!ELEMENT resource-env-ref ( resource-env-ref-name, jndi-name )>
341
342 <!--
343 This node holds all the runtime bindings of a resource reference.
344 -->
345 <!ELEMENT resource-ref (res-ref-name, jndi-name, default-resource-principal?)>
346
347 <!ELEMENT default-resource-principal (name, password)>
348
349 <!ELEMENT security-role-mapping (role-name, (principal-name | group-name)+)>
350
351 <!--
352 Information about a web service endpoint.
353 -->
354 <!ELEMENT webservice-endpoint ( port-component-name, endpoint-address-uri?, login-config?, transport-guarantee?, service-qname?, tie-class?, servlet-impl-class? )>
355
356 <!--
357 Optional authentication configuration for an EJB web service endpoint.
358 Not needed for servet web service endpoints. Their security configuration
359 is contained in the standard web application descriptor.
360 -->
361 <!ELEMENT login-config ( auth-method )>
362
363 <!--
364 The service-qname element declares the specific WSDL service
365 element that is being refered to. It is not set by the deployer.
366 It is derived during deployment.
367 -->
368 <!ELEMENT service-qname (namespaceURI, localpart)>
369
370 <!--
371 Runtime information about a web service.
372 wsdl-publish-location is optionally used to specify
373 where the final wsdl and any dependent files should be stored. This location
374 resides on the file system from which deployment is initiated.
375 -->
376 <!ELEMENT webservice-description ( webservice-description-name, wsdl-publish-location? )>
377
378 <!--
379 Runtime settings for a web service reference. In the simplest case,
380 there is no runtime information required for a service ref. Runtime info
381 is only needed in the following cases :
382  * to define the port that should be used to resolve a container-managed port
383  * to define default Stub/Call property settings for Stub objects
384  * to define the URL of a final WSDL document to be used instead of
385 the one packaged with a service-ref
386 -->
387 <!ELEMENT service-ref ( service-ref-name, port-info*, call-property*, wsdl-override?, service-impl-class?, service-qname? )>
388
389 <!--
390 Information for a port within a service-reference.
391
392 Either service-endpoint-interface or wsdl-port or both
393 (service-endpoint-interface and wsdl-port) should be specified.
394
395 If both are specified, wsdl-port represents the
396 port the container should choose for container-managed port selection.
397
398 The same wsdl-port value must not appear in
399 more than one port-info entry within the same service-ref.
400
401 If a particular service-endpoint-interface is using container-managed port
402 selection, it must not appear in more than one port-info entry
403 within the same service-ref.
404 -->
405 <!ELEMENT port-info ( service-endpoint-interface?, wsdl-port?, stub-property*, call-property* )>
406
407 <!--
408 Port used in port-info.
409 -->
410 <!ELEMENT wsdl-port ( namespaceURI, localpart )>
411
412 <!--
413 JAXRPC property values that should be set on a stub before it's returned to
414 to the web service client. The property names can be any properties supported
415 by the JAXRPC Stub implementation. See javadoc for javax.xml.rpc.Stub
416 -->
417 <!ELEMENT stub-property ( name, value )>
418
419 <!--
420 JAXRPC property values that should be set on a Call object before it's
421 returned to the web service client. The property names can be any
422 properties supported by the JAXRPC Call implementation. See javadoc
423 for javax.xml.rpc.Call
424 -->
425 <!ELEMENT call-property ( name, value )>
426
427 <!--
428 This info is used only by studio plug-in;it is NOT the part of the orgianl DTD.
429 Used by plugin to store parameters needed to execute an Application client.
430 -->
431 <!ELEMENT plugin-data ( auto-generate-sql?, client-jar-path?, client-args? )>
432 <!ELEMENT auto-generate-sql (#PCDATA)>
433 <!ELEMENT client-jar-path (#PCDATA)>
434 <!ELEMENT client-args (#PCDATA)>
435
436 <!--
437 The ejb ref name locates the name of the ejb reference in the application.
438 -->
439 <!ELEMENT ejb-ref-name (#PCDATA)>
440
441 <!--
442 The text in this node is a jndi name.
443 -->
444 <!ELEMENT jndi-name (#PCDATA)>
445
446 <!--
447 The name of a resource env reference.
448 -->
449 <!ELEMENT resource-env-ref-name (#PCDATA)>
450
451 <!--
452 The name of a resource reference.
453 -->
454 <!ELEMENT res-ref-name (#PCDATA)>
455
456 <!--
457 This text nodes holds a name string.
458 -->
459 <!ELEMENT name (#PCDATA)>
460
461 <!--
462 This element holds password text.
463 -->
464 <!ELEMENT password (#PCDATA)>
465
466 <!ELEMENT role-name (#PCDATA)>
467
468 <!ELEMENT principal-name (#PCDATA)>
469
470 <!ELEMENT group-name (#PCDATA)>
471
472 <!--
473 Unique name of a port component within a module
474 -->
475 <!ELEMENT port-component-name ( #PCDATA )>
476
477 <!--
478 Relative path combined with web server root to form fully qualified
479 endpoint address for a web service endpoint. For servlet endpoints, this
480 value is relative to the servlet's web application context root. In
481 all cases, this value must be a fixed pattern(i.e. no "*" allowed).
482 If the web service endpoint is a servlet that only implements a single
483 endpoint has only one url-pattern, it is not necessary to set
484 this value since the container can derive it from web.xml.
485 -->
486 <!ELEMENT endpoint-address-uri ( #PCDATA )>
487
488 <!--
489 The namespaceURI element indicates a URI.
490 -->
491 <!ELEMENT namespaceURI (#PCDATA)>
492
493 <!--
494 The localpart element indicates the local part of a QNAME.
495 -->
496 <!ELEMENT localpart (#PCDATA)>
497
498 <!--
499 auth-method element describes the authentication method. The only supported value
500 is USERNAME_PASSWORD
501 -->
502 <!ELEMENT auth-method ( #PCDATA )>
503
504 <!--
505 Specifies that the communication between client and server should
506 be NONE, INTEGRAL, or CONFIDENTIAL. NONE means that the application
507 does not require any transport guarantees. A value of INTEGRAL means
508 that the application requires that the data sent between the client
509 and server be sent in such a way that it can't be changed in transit.
510 CONFIDENTIAL means that the application requires that the data be
511 transmitted in a fashion that prevents other entities from observing
512 the contents of the transmission. In most cases, the presence of the
513 INTEGRAL or CONFIDENTIAL flag will indicate that the use of SSL is
514 required.
515 -->
516 <!ELEMENT transport-guarantee ( #PCDATA )>
517
518 <!--
519 The name of tie implementation class for a port-component. This is
520 not specified by the deployer. It is derived during deployment.
521 -->
522 <!ELEMENT tie-class (#PCDATA)>
523
524 <!--
525 Name of application-written servlet impl class contained in deployed war.
526 This is not set by the deployer. It is derived by the container
527 during deployment.
528 -->
529 <!ELEMENT servlet-impl-class (#PCDATA)>
530
531 <!--
532 Unique name of a webservice within a module
533 -->
534 <!ELEMENT webservice-description-name ( #PCDATA )>
535
536 <!--
537 file: URL of a directory to which a web-service-description's wsdl should be
538 published during deployment. Any required files will be published to this
539 directory, preserving their location relative to the module-specific
540 wsdl directory(META-INF/wsdl or WEB-INF/wsdl).
541
542 Example :
543
544   For an ejb.jar whose webservices.xml wsdl-file element contains
545     META-INF/wsdl/a/Foo.wsdl
546
547   <wsdl-publish-location>file:/home/user1/publish
548   </wsdl-publish-location>
549
550   The final wsdl will be stored in /home/user1/publish/a/Foo.wsdl
551 -->
552 <!ELEMENT wsdl-publish-location ( #PCDATA )>
553
554 <!--
555 Coded name (relative to java:comp/env) for a service-reference
556 -->
557 <!ELEMENT service-ref-name ( #PCDATA )>
558
559 <!--
560 Fully qualified name of service endpoint interface
561 -->
562 <!ELEMENT service-endpoint-interface ( #PCDATA )>
563
564 <!--
565 This text nodes holds a value string.
566 -->
567 <!ELEMENT value (#PCDATA)>
568
569 <!--
570 This is a valid URL pointing to a final WSDL document. It is optional.
571 If specified, the WSDL document at this URL will be used during
572 deployment instead of the WSDL document associated with the
573 service-ref in the standard deployment descriptor.
574
575 Examples :
576
577   // available via HTTP
578   <wsdl-override>http://localhost:8000/myservice/myport?WSDL</wsdl-override>
579
580   // in a file
581   <wsdl-override>file:/home/user1/myfinalwsdl.wsdl</wsdl-override>
582 -->
583 <!ELEMENT wsdl-override ( #PCDATA )>
584
585 <!--
586 Name of generated service implementation class. This is not set by the
587 deployer. It is derived during deployment.
588 -->
589 <!ELEMENT service-impl-class ( #PCDATA )>
590
591 <!--
592 This node holds information about a logical message destination
593 -->
594 <!ELEMENT message-destination (message-destination-name, jndi-name)>
595
596 <!--
597 This node holds the name of a logical message destination
598 -->
599 <!ELEMENT message-destination-name (#PCDATA)>
600
601 */

602
Popular Tags