KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_ws > deployment > xml > PortComponent


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  *
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or 1any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20  * USA
21  *
22  * Initial developer: JOnAS team
23  * --------------------------------------------------------------------------
24  * $Id: PortComponent.java,v 1.3 2004/07/01 14:54:12 sauthieg Exp $
25  * --------------------------------------------------------------------------
26  */

27
28 package org.objectweb.jonas_ws.deployment.xml;
29
30 import org.objectweb.jonas_lib.deployment.xml.AbsDescriptionElement;
31 import org.objectweb.jonas_lib.deployment.xml.DescriptionGroupXml;
32 import org.objectweb.jonas_lib.deployment.xml.Handler;
33 import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
34 import org.objectweb.jonas_lib.deployment.xml.Qname;
35
36 /**
37  * This class defines the implementation of the element port-component
38  * (use here the common handler object defined in jonas-lib,
39  * even if there is no "port-name" in our case)
40  *
41  * @author JOnAS team
42  */

43
44 public class PortComponent extends AbsDescriptionElement implements DescriptionGroupXml {
45
46     /**
47      * port-component-name
48      */

49     private String JavaDoc portComponentName = null;
50
51     /**
52      * wsdl-port
53      */

54     private Qname wsdlPort = null;
55
56     /**
57      * service-endpoint-interface
58      */

59     private String JavaDoc serviceEndpointInterface = null;
60
61     /**
62      * service-impl-bean
63      */

64     private ServiceImplBean serviceImplBean = null;
65
66     /**
67      * handler
68      * (use here the common handler object defined in jonas-lib,
69      * even if there is no "port-name" in our case)
70      */

71     private JLinkedList handlerList = null;
72
73
74     /**
75      * Constructor
76      */

77     public PortComponent() {
78         super();
79         handlerList = new JLinkedList("handler");
80     }
81
82     /**
83      * Gets the port-component-name
84      * @return the port-component-name
85      */

86     public String JavaDoc getPortComponentName() {
87         return portComponentName;
88     }
89
90     /**
91      * Set the port-component-name
92      * @param portComponentName portComponentName
93      */

94     public void setPortComponentName(String JavaDoc portComponentName) {
95         this.portComponentName = portComponentName;
96     }
97
98     /**
99      * Gets the wsdl-port
100      * @return the wsdl-port
101      */

102     public Qname getWsdlPort() {
103         return wsdlPort;
104     }
105
106     /**
107      * Set the wsdl-port
108      * @param wsdlPort wsdlPort
109      */

110     public void setWsdlPort(Qname wsdlPort) {
111         this.wsdlPort = wsdlPort;
112     }
113
114     /**
115      * Gets the service-endpoint-interface
116      * @return the service-endpoint-interface
117      */

118     public String JavaDoc getServiceEndpointInterface() {
119         return serviceEndpointInterface;
120     }
121
122     /**
123      * Set the service-endpoint-interface
124      * @param serviceEndpointInterface serviceEndpointInterface
125      */

126     public void setServiceEndpointInterface(String JavaDoc serviceEndpointInterface) {
127         this.serviceEndpointInterface = serviceEndpointInterface;
128     }
129
130     /**
131      * Gets the service-impl-bean
132      * @return the service-impl-bean
133      */

134     public ServiceImplBean getServiceImplBean() {
135         return serviceImplBean;
136     }
137
138     /**
139      * Set the service-impl-bean
140      * @param serviceImplBean serviceImplBean
141      */

142     public void setServiceImplBean(ServiceImplBean serviceImplBean) {
143         this.serviceImplBean = serviceImplBean;
144     }
145
146     /**
147      * Gets the handler
148      * @return the handler
149      */

150     public JLinkedList getHandlerList() {
151         return handlerList;
152     }
153
154     /**
155      * Set the handler
156      * @param handlerList handler
157      */

158     public void setHandlerList(JLinkedList handlerList) {
159         this.handlerList = handlerList;
160     }
161
162     /**
163      * Add a new handler element to this object
164      * @param handler the handlerobject
165      */

166     public void addHandler(Handler handler) {
167         handlerList.add(handler);
168     }
169
170     /**
171      * Represents this element by it's XML description.
172      * @param indent use this indent for prexifing XML representation.
173      * @return the XML description of this object.
174      */

175     public String JavaDoc toXML(int indent) {
176         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
177         sb.append(indent(indent));
178         sb.append("<port-component>\n");
179
180         indent += 2;
181
182         // description
183
sb.append(xmlElement(getDescription(), "description", indent));
184         // display-name
185
sb.append(xmlElement(getDisplayName(), "display-name", indent));
186         // icon
187
sb.append(getIcon().toXML(indent));
188         // port-component-name
189
sb.append(xmlElement(portComponentName, "port-component-name", indent));
190         // wsdl-port
191
if (wsdlPort != null) {
192             sb.append(wsdlPort.toXML(indent));
193         }
194         // service-endpoint-interface
195
sb.append(xmlElement(serviceEndpointInterface, "service-endpoint-interface", indent));
196         // service-impl-bean
197
if (serviceImplBean != null) {
198             sb.append(serviceImplBean.toXML(indent));
199         }
200         // handler
201
sb.append(handlerList.toXML(indent));
202         indent -= 2;
203         sb.append(indent(indent));
204         sb.append("</port-component>\n");
205
206         return sb.toString();
207     }
208 }
209
Popular Tags