KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_ws > deployment > api > JaxRpcPortComponentDesc


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 any 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 : Sauthier Guillaume
22  * --------------------------------------------------------------------------
23  * $Id: JaxRpcPortComponentDesc.java,v 1.9 2004/07/01 14:54:12 sauthieg Exp $
24  * --------------------------------------------------------------------------
25  */

26 package org.objectweb.jonas_ws.deployment.api;
27
28 import org.objectweb.jonas_web.deployment.api.WebContainerDeploymentDesc;
29
30 import org.objectweb.jonas_ws.deployment.xml.JonasPortComponent;
31 import org.objectweb.jonas_ws.deployment.xml.PortComponent;
32
33 /**
34  * PortComponent using JaxRpc class.
35  * @author Guillaume Sauthier
36  */

37 public class JaxRpcPortComponentDesc extends PortComponentDesc {
38
39     /** the PortComponent is linked to a servlet */
40     private WebContainerDeploymentDesc webDesc = null;
41
42     /**
43      * Constructs a JaxRpcPortComponentDesc
44      * @param cl ClassLoader of the module containing PortComponent
45      * @param pc XML Element of the PortComponent ( <port-component>)
46      * @param jpc XML Element jonas-port-component
47      * @param parent ServiceDesc containing the PortComponent
48      * @throws WSDeploymentDescException When call to PortComponentDesc
49      * constructor fails.
50      */

51     JaxRpcPortComponentDesc(ClassLoader JavaDoc cl, PortComponent pc, JonasPortComponent jpc, ServiceDesc parent)
52             throws WSDeploymentDescException {
53
54         super(cl, pc, jpc, parent);
55
56         // set ServiceImplBean link from servlet-link element
57
setSibLink(pc.getServiceImplBean().getServletLink());
58     }
59
60     /**
61      * Return true if the Service Impl Bean is an EJB.
62      * @return true if the Service Impl Bean is an EJB.
63      */

64     public boolean hasBeanImpl() {
65         return false;
66     }
67
68     /**
69      * Returns true if the Service Impl Bean is a JaxRpc component.
70      * @return true if the Service Impl Bean is a JaxRpc component.
71      */

72     public boolean hasJaxRpcImpl() {
73         return true;
74     }
75
76     /**
77      * Returns the WebContainerDeploymentDesc object linked with this
78      * portComponentDesc
79      * @return the WebContainerDeploymentDesc object linked with this
80      * portComponentDesc
81      */

82     public WebContainerDeploymentDesc getWebDesc() {
83         return webDesc;
84     }
85
86     /**
87      * Set the webDesc for this endpoint.
88      * @param web The web DD declaring the JaxRpc Endpoint.
89      */

90     public void setWebDesc(WebContainerDeploymentDesc web) {
91         webDesc = web;
92         setSib(web.getServletClassname(getSibLink()));
93     }
94
95     /**
96      * Setter method for J2EE component linking.
97      * @param desc the descriptor of the component implementing the endpoint.
98      * @throws WSDeploymentDescException when desc is an unknown type.
99      */

100     public void setDesc(Object JavaDoc desc) throws WSDeploymentDescException {
101         if (desc instanceof WebContainerDeploymentDesc) {
102             setWebDesc((WebContainerDeploymentDesc) desc);
103         } else {
104             throw new IllegalStateException JavaDoc(getI18n().getMessage("JaxRpcPortComponentDesc.illegalState", //$NON-NLS-1$
105
WebContainerDeploymentDesc.class.getName()));
106         }
107     }
108
109     /**
110      * @return Returns a String representation of the JaxRpcPortComponentDesc
111      */

112     public String JavaDoc toString() {
113         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
114
115         sb.append(super.toString());
116         sb.append("\ngetWebDesc()=" + getWebDesc()); //$NON-NLS-1$
117

118         return sb.toString();
119     }
120 }
Popular Tags