001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * Initial Developer : Sauthier Guillaume
022: * --------------------------------------------------------------------------
023: * $Id: JaxRpcPortComponentDesc.java 5044 2004-07-01 14:54:13Z sauthieg $
024: * --------------------------------------------------------------------------
025: */package org.objectweb.jonas_ws.deployment.api;
026:
027: import org.objectweb.jonas_web.deployment.api.WebContainerDeploymentDesc;
028:
029: import org.objectweb.jonas_ws.deployment.xml.JonasPortComponent;
030: import org.objectweb.jonas_ws.deployment.xml.PortComponent;
031:
032: /**
033: * PortComponent using JaxRpc class.
034: * @author Guillaume Sauthier
035: */
036: public class JaxRpcPortComponentDesc extends PortComponentDesc {
037:
038: /** the PortComponent is linked to a servlet */
039: private WebContainerDeploymentDesc webDesc = null;
040:
041: /**
042: * Constructs a JaxRpcPortComponentDesc
043: * @param cl ClassLoader of the module containing PortComponent
044: * @param pc XML Element of the PortComponent ( <port-component>)
045: * @param jpc XML Element jonas-port-component
046: * @param parent ServiceDesc containing the PortComponent
047: * @throws WSDeploymentDescException When call to PortComponentDesc
048: * constructor fails.
049: */
050: JaxRpcPortComponentDesc(ClassLoader cl, PortComponent pc,
051: JonasPortComponent jpc, ServiceDesc parent)
052: throws WSDeploymentDescException {
053:
054: super (cl, pc, jpc, parent);
055:
056: // set ServiceImplBean link from servlet-link element
057: setSibLink(pc.getServiceImplBean().getServletLink());
058: }
059:
060: /**
061: * Return true if the Service Impl Bean is an EJB.
062: * @return true if the Service Impl Bean is an EJB.
063: */
064: public boolean hasBeanImpl() {
065: return false;
066: }
067:
068: /**
069: * Returns true if the Service Impl Bean is a JaxRpc component.
070: * @return true if the Service Impl Bean is a JaxRpc component.
071: */
072: public boolean hasJaxRpcImpl() {
073: return true;
074: }
075:
076: /**
077: * Returns the WebContainerDeploymentDesc object linked with this
078: * portComponentDesc
079: * @return the WebContainerDeploymentDesc object linked with this
080: * portComponentDesc
081: */
082: public WebContainerDeploymentDesc getWebDesc() {
083: return webDesc;
084: }
085:
086: /**
087: * Set the webDesc for this endpoint.
088: * @param web The web DD declaring the JaxRpc Endpoint.
089: */
090: public void setWebDesc(WebContainerDeploymentDesc web) {
091: webDesc = web;
092: setSib(web.getServletClassname(getSibLink()));
093: }
094:
095: /**
096: * Setter method for J2EE component linking.
097: * @param desc the descriptor of the component implementing the endpoint.
098: * @throws WSDeploymentDescException when desc is an unknown type.
099: */
100: public void setDesc(Object desc) throws WSDeploymentDescException {
101: if (desc instanceof WebContainerDeploymentDesc) {
102: setWebDesc((WebContainerDeploymentDesc) desc);
103: } else {
104: throw new IllegalStateException(getI18n().getMessage(
105: "JaxRpcPortComponentDesc.illegalState", //$NON-NLS-1$
106: WebContainerDeploymentDesc.class.getName()));
107: }
108: }
109:
110: /**
111: * @return Returns a String representation of the JaxRpcPortComponentDesc
112: */
113: public String toString() {
114: StringBuffer sb = new StringBuffer();
115:
116: sb.append(super .toString());
117: sb.append("\ngetWebDesc()=" + getWebDesc()); //$NON-NLS-1$
118:
119: return sb.toString();
120: }
121: }
|