KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > deploy > ContextService


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18
19 package org.apache.catalina.deploy;
20
21 import java.io.Serializable JavaDoc;
22
23 /**
24  * Representation of a web service reference for a web application, as
25  * represented in a <code>&lt;service-ref&gt;</code> element in the
26  * deployment descriptor.
27  *
28  * @author Fabien Carrion
29  * @version $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
30  */

31
32 public class ContextService extends ResourceBase implements Serializable JavaDoc {
33
34
35     // ------------------------------------------------------------- Properties
36

37
38     /**
39      * The WebService reference name.
40      */

41     private String JavaDoc displayname = null;
42
43     public String JavaDoc getDisplayname() {
44         return (this.displayname);
45     }
46
47     public void setDisplayname(String JavaDoc displayname) {
48         this.displayname = displayname;
49     }
50
51     /**
52      * An icon for this WebService.
53      */

54     private String JavaDoc icon = null;
55
56     public String JavaDoc getIcon() {
57         return (this.icon);
58     }
59
60     public void setIcon(String JavaDoc icon) {
61         this.icon = icon;
62     }
63
64     /**
65      * An icon for this WebService.
66      */

67     private String JavaDoc serviceinterface = null;
68
69     public String JavaDoc getServiceinterface() {
70         return (this.serviceinterface);
71     }
72
73     public void setServiceinterface(String JavaDoc serviceinterface) {
74         this.serviceinterface = serviceinterface;
75     }
76
77     /**
78      * Contains the location (relative to the root of
79      * the module) of the web service WSDL description.
80      */

81     private String JavaDoc wsdlfile = null;
82
83     public String JavaDoc getWsdlfile() {
84         return (this.wsdlfile);
85     }
86
87     public void setWsdlfile(String JavaDoc wsdlfile) {
88         this.wsdlfile = wsdlfile;
89     }
90
91     /**
92      * A file specifying the correlation of the WSDL definition
93      * to the interfaces (Service Endpoint Interface, Service Interface).
94      */

95     private String JavaDoc jaxrpcmappingfile = null;
96
97     public String JavaDoc getJaxrpcmappingfile() {
98         return (this.jaxrpcmappingfile);
99     }
100
101     public void setJaxrpcmappingfile(String JavaDoc jaxrpcmappingfile) {
102         this.jaxrpcmappingfile = jaxrpcmappingfile;
103     }
104
105     /**
106      * Declares the specific WSDL service element that is being referred to.
107      * It is not specified if no wsdl-file is declared or if WSDL contains only
108      * 1 service element.
109      *
110      * A service-qname is composed by a namespaceURI and a localpart.
111      * It must be defined if more than 1 service is declared in the WSDL.
112      *
113      * serviceqname[0] : namespaceURI
114      * serviceqname[1] : localpart
115      */

116     private String JavaDoc[] serviceqname = new String JavaDoc[2];
117
118     public String JavaDoc[] getServiceqname() {
119         return (this.serviceqname);
120     }
121
122     public void setServiceqname(String JavaDoc[] serviceqname) {
123         this.serviceqname = serviceqname;
124     }
125
126     public void setServiceqname(String JavaDoc serviceqname, int i) {
127         this.serviceqname[i] = serviceqname;
128     }
129
130     public void setNamespaceURI(String JavaDoc namespaceuri) {
131         this.serviceqname[0] = namespaceuri;
132     }
133
134     public void setLocalpart(String JavaDoc localpart) {
135         this.serviceqname[1] = localpart;
136     }
137
138     /**
139      * Declares a client dependency on the container to resolving a Service Endpoint Interface
140      * to a WSDL port. It optionally associates the Service Endpoint Interface with a
141      * particular port-component.
142      *
143      * portcomponent[0] : service-endpoint-interface
144      * portcomponent[1] : port-component-link
145      */

146     private String JavaDoc[] portcomponent = new String JavaDoc[2];
147
148     public String JavaDoc[] getPortcomponent() {
149         return (this.portcomponent);
150     }
151
152     public void setPortcomponent(String JavaDoc[] portcomponent) {
153         this.portcomponent = portcomponent;
154     }
155
156     public void setPortcomponent(String JavaDoc portcomponent, int i) {
157         this.portcomponent[i] = portcomponent;
158     }
159
160     public void setServiceendpoint(String JavaDoc serviceendpoint) {
161         this.portcomponent[0] = serviceendpoint;
162     }
163
164     public void setPortlink(String JavaDoc portlink) {
165         this.portcomponent[1] = portlink;
166     }
167
168     /**
169      * A list of Handler to use for this service-ref.
170      *
171      * The instanciation of the handler have to be done.
172      */

173     private String JavaDoc handler = null;
174
175     public String JavaDoc getHandler() {
176         return (this.handler);
177     }
178
179     public void setHandler(String JavaDoc handler) {
180         this.handler = handler;
181     }
182
183
184     // --------------------------------------------------------- Public Methods
185

186
187     /**
188      * Return a String representation of this object.
189      */

190     public String JavaDoc toString() {
191
192         StringBuffer JavaDoc sb = new StringBuffer JavaDoc("ContextService[");
193         sb.append("name=");
194         sb.append(getName());
195         if (getDescription() != null) {
196             sb.append(", description=");
197             sb.append(getDescription());
198         }
199         if (getType() != null) {
200             sb.append(", type=");
201             sb.append(getType());
202         }
203         if (displayname != null) {
204             sb.append(", displayname=");
205             sb.append(displayname);
206         }
207         if (serviceinterface != null) {
208             sb.append(", serviceinterface=");
209             sb.append(serviceinterface);
210         }
211         if (icon != null) {
212             sb.append(", icon=");
213             sb.append(icon);
214         }
215         if (wsdlfile != null) {
216             sb.append(", wsdl-file=");
217             sb.append(wsdlfile);
218         }
219         if (jaxrpcmappingfile != null) {
220             sb.append(", jaxrpc-mapping-file=");
221             sb.append(jaxrpcmappingfile);
222         }
223         if (serviceqname != null) {
224             sb.append(", service-qname=");
225             sb.append(serviceqname);
226         }
227         if (portcomponent != null) {
228             sb.append(", port-component=");
229             sb.append(portcomponent);
230         }
231         if (handler != null) {
232             sb.append(", handler=");
233             sb.append(handler);
234         }
235         sb.append("]");
236         return (sb.toString());
237
238     }
239
240 }
241
Popular Tags