KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_lib > deployment > xml > JonasPortComponentRef


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or 1any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * Initial developer: Florent BENOIT
22  * --------------------------------------------------------------------------
23  * $Id: JonasPortComponentRef.java,v 1.1 2004/07/01 14:54:12 sauthieg Exp $
24  * --------------------------------------------------------------------------
25  */

26
27 package org.objectweb.jonas_lib.deployment.xml;
28
29
30
31 /**
32  * This class defines the implementation of the element jonas-port-component-ref.
33  * @author Florent Benoit
34  */

35 public class JonasPortComponentRef extends AbsElement {
36
37     /**
38      * service endpoint interface
39      */

40     private String JavaDoc serviceEndpointInterface = null;
41
42     /**
43      * wsdl port
44      */

45     private Qname wsdlPort = null;
46
47     /**
48      * jonas-stub-property list
49      */

50     private JLinkedList jonasStubPropList = null;
51
52     /**
53      * jonas-call-property list
54      */

55     private JLinkedList jonasCallPropList = null;
56
57     /**
58      * Constructor : build a new JonasServiceRef object
59      */

60     public JonasPortComponentRef() {
61         jonasStubPropList = new JLinkedList("jonas-stub-property");
62         jonasCallPropList = new JLinkedList("jonas-call-property");
63     }
64
65
66     // Setters
67

68
69     /**
70      * Sets the wsdl port QName of the jonas-port-component-ref
71      * @param wsdlPort wsdl port QName of the jonas-port-component-ref
72      */

73     public void setWsdlPort(Qname wsdlPort) {
74         this.wsdlPort = wsdlPort;
75     }
76
77     /**
78      * Sets the service endpoint interface of the port-component-ref
79      * @param serviceEndpointInterface service endpoint interface of the port-component-ref
80      */

81     public void setServiceEndpointInterface(String JavaDoc serviceEndpointInterface) {
82         this.serviceEndpointInterface = serviceEndpointInterface;
83     }
84
85     /**
86      * Add a parameter
87      * @param jonasCallProperty the JonasCallProperty object to add to our list
88      */

89     public void addJonasCallProperty(JonasCallProperty jonasCallProperty) {
90         jonasCallPropList.add(jonasCallProperty);
91     }
92
93     /**
94      * Add a parameter
95      * @param jonasStubProperty the JonasStubProperty object to add to our list
96      */

97     public void addJonasStubProperty(JonasStubProperty jonasStubProperty) {
98         jonasStubPropList.add(jonasStubProperty);
99     }
100
101
102     // Getters
103

104     /**
105      * @return the service endpoint interface of the port-component-ref
106      */

107     public String JavaDoc getServiceEndpointInterface() {
108         return serviceEndpointInterface;
109     }
110
111     /**
112      * @return the wsdl port QName of the jonas-port-component-ref
113      */

114     public Qname getWsdlPort() {
115         return wsdlPort;
116     }
117
118     /**
119      * @return the list of jonas-call-property
120      */

121     public JLinkedList getJonasCallPropertyList() {
122         return jonasCallPropList;
123     }
124
125     /**
126      * @return the list of jonas-stub-property
127      */

128     public JLinkedList getJonasStubPropertyList() {
129         return jonasStubPropList;
130     }
131
132
133     /**
134      * Represents this element by it's XML description.
135      * @param indent use this indent for prexifing XML representation.
136      * @return the XML description of this object.
137      */

138     public String JavaDoc toXML(int indent) {
139         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
140         sb.append(indent(indent));
141         sb.append("<jonas-port-component-ref>\n");
142
143         indent += 2;
144
145         // service-endpoint-interface
146
if (serviceEndpointInterface != null) {
147             sb.append(xmlElement(serviceEndpointInterface, "service-endpoint-interface", indent));
148         }
149
150         // wsdl-port
151
if (wsdlPort != null) {
152             sb.append(wsdlPort.toXML(indent));
153         }
154
155         // jonas-stub-property
156
sb.append(jonasStubPropList.toXML(indent));
157
158         // jonas-call-property
159
sb.append(jonasCallPropList.toXML(indent));
160
161         indent -= 2;
162         sb.append(indent(indent));
163         sb.append("</jonas-port-component-ref>\n");
164
165         return sb.toString();
166     }
167 }
168
Popular Tags