KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_lib > deployment > api > EjbLocalRefDesc


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 1any 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: Christophe Ney
22  * --------------------------------------------------------------------------
23  * $Id: EjbLocalRefDesc.java,v 1.2 2004/05/11 08:07:50 sauthieg Exp $
24  * --------------------------------------------------------------------------
25  */

26
27 package org.objectweb.jonas_lib.deployment.api;
28
29 import org.objectweb.jonas_lib.deployment.xml.EjbLocalRef;
30
31 /**
32  * This class represents the description of an EjblocalRef object
33  * @author Christophe Ney
34  * @author Florent Benoit
35  */

36 public class EjbLocalRefDesc {
37
38     /**
39      * The ejb local ref name.
40      */

41     private String JavaDoc ejbRefName = null;
42
43     /**
44      * The type of the ejb ref
45      */

46     private String JavaDoc ejbRefType = null;
47
48     /**
49      * The local home of the ejb local ref.
50      */

51     private String JavaDoc localHome = null;
52
53     /**
54      * The local interface name of the ejb local ref.
55      */

56     private String JavaDoc local = null;
57
58     /**
59      * The ejb link of the ejb local ref.
60      */

61     private String JavaDoc ejbLink = null;
62
63     /**
64      * The jndi name of the ejb local ref.
65      */

66     private String JavaDoc jndiName = null;
67
68
69     /**
70      * Construct a descriptor for an ejb-local-ref tag.
71      * @param ejbLocalRef the ejb local ref resulting of the xml parsing.
72      * @throws DeploymentDescException when missing information for
73      * creating the EjbLocalRefDesc.
74      */

75     public EjbLocalRefDesc(EjbLocalRef ejbLocalRef) throws DeploymentDescException {
76         ejbRefName = ejbLocalRef.getEjbRefName();
77         ejbRefType = ejbLocalRef.getEjbRefType();
78         localHome = ejbLocalRef.getLocalHome();
79         local = ejbLocalRef.getLocal();
80         if (ejbLocalRef.getEjbLink() == null) {
81             String JavaDoc err = "ejb-link missing for ejb-local-ref '" + ejbRefName + "'.";
82             throw new DeploymentDescException(err);
83         }
84         ejbLink = ejbLocalRef.getEjbLink();
85     }
86
87     /**
88      * Get the name of the ejb-ref
89      * @return String representation of the ejb-ref-name.
90      */

91     public String JavaDoc getEjbRefName() {
92         return ejbRefName;
93     }
94
95     /**
96      * Get the ejb-ref-type.
97      * @return String representation of the ejb-ref-type.
98      */

99     public String JavaDoc getEjbRefType() {
100         return ejbRefType;
101     }
102
103     /**
104      * Get the LocalHome class of the target bean
105      * @return String representation of the class.
106      */

107     public String JavaDoc getLocalHome() {
108         return localHome;
109     }
110
111     /**
112      * Get the Local class of the target bean
113      * @return String representation of the class.
114      */

115     public String JavaDoc getLocal() {
116         return local;
117     }
118
119     /**
120      * Get the ejb-link
121      * @return String representation of the ejb-link
122      */

123     public String JavaDoc getEjbLink() {
124         return ejbLink;
125     }
126
127     /**
128      * Get the jndi name of the ejb-local-ref.
129      * @return the string representation of the JNDI name
130      */

131     public String JavaDoc getJndiLocalName() {
132         return jndiName;
133     }
134
135     /**
136      * Set the jndi name of the ejb-local-ref.
137      * @param jndiName the string representation of the jndi name.
138      */

139     public void setJndiLocalName(String JavaDoc jndiName) {
140         this.jndiName = jndiName;
141     }
142
143     /**
144      * String representation of the object for test purpose
145      * @return String representation of this object
146      */

147     public String JavaDoc toString() {
148         StringBuffer JavaDoc ret = new StringBuffer JavaDoc();
149         ret.append("\ngetEjbRefName()=" + getEjbRefName());
150         ret.append("\ngetEjbRefType()=" + getEjbRefType());
151         ret.append("\ngetLocalHome()=" + getLocalHome());
152         ret.append("\ngetLocal()=" + getLocal());
153         ret.append("\ngetEjbLink()=" + getEjbLink());
154         ret.append("\ngetJndiLocalName()=" + getJndiLocalName());
155         return ret.toString();
156     }
157
158 }
159
Popular Tags