KickJava   Java API By Example, From Geeks To Geeks.

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


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: SSBPortComponentDesc.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_ejb.deployment.api.SessionStatelessDesc;
29
30 import org.objectweb.jonas_ws.deployment.xml.JonasPortComponent;
31 import org.objectweb.jonas_ws.deployment.xml.PortComponent;
32
33 /**
34  * PortComponentDesc specialization for Session Bean exposed as WebServices.
35  * @author Guillaume Sauthier
36  */

37 public class SSBPortComponentDesc extends PortComponentDesc {
38
39     /** linked to the StatelessSessionBean */
40     private SessionStatelessDesc ssDesc = null;
41
42     /**
43      * Constructs a new SSBPortComponentDesc.
44      * @param cl module ClassLoader
45      * @param pc XML Element 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     SSBPortComponentDesc(ClassLoader JavaDoc cl, PortComponent pc, JonasPortComponent jpc, ServiceDesc parent) throws WSDeploymentDescException {
52
53         super(cl, pc, jpc, parent);
54
55         // set ServiceImplBean link from ejb-link element
56
setSibLink(pc.getServiceImplBean().getEjbLink());
57     }
58
59     /**
60      * Return true if the Service Impl Bean is an EJB.
61      * @return true if the Service Impl Bean is an EJB.
62      */

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

71     public boolean hasJaxRpcImpl() {
72         return false;
73     }
74
75     /**
76      * Return the SessionStatelessDesc object linked with this
77      * portComponentDesc.
78      * @return the SessionStatelessDesc object linked with this
79      * portComponentDesc.
80      */

81     public SessionStatelessDesc getSessionStatelessDesc() {
82         return ssDesc;
83     }
84
85     /**
86      * Set the beanDesc for this endpoint.
87      * @param bean The SSB Object declaring the endpoint.
88      */

89     public void setSessionStatelessDesc(SessionStatelessDesc bean) {
90         ssDesc = bean;
91         setSib(bean.getEjbClass().getName());
92     }
93
94     /**
95      * Setter method for J2EE component linking.
96      * @param desc the descriptor of the component implementing the endpoint.
97      * @throws WSDeploymentDescException when desc is an unknown type.
98      */

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

111     public String JavaDoc toString() {
112         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
113
114         sb.append(super.toString());
115         sb.append("\ngetSessionStatelessDesc().displayName=" + getSessionStatelessDesc());
116
117         return sb.toString();
118     }
119 }
Popular Tags