KickJava   Java API By Example, From Geeks To Geeks.

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


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999-2004 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  * --------------------------------------------------------------------------
22  * $Id: EjbRefDesc.java,v 1.3 2004/10/06 14:42:22 benoitf Exp $
23  * --------------------------------------------------------------------------
24  */

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

36 public class EjbRefDesc {
37
38     /**
39      * The ejb 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      * Fully qualified name of the enterprise bean's home interface
50      */

51     private String JavaDoc home = null;
52
53     /**
54      * Fully qualified name of the enterprise bean's remote interface
55      */

56     private String JavaDoc remote = 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-ref tag.
71      * @param ejbRef the ejb ref resulting of the xml parsing.
72      * @param jonasEjbRef the jonas ejb ref resulting of the xml parsing.
73      */

74     public EjbRefDesc(EjbRef ejbRef, JonasEjbRef jonasEjbRef) {
75         ejbRefName = ejbRef.getEjbRefName();
76         ejbRefType = ejbRef.getEjbRefType();
77         ejbLink = null;
78         if (ejbRef.getEjbLink() != null) {
79             ejbLink = ejbRef.getEjbLink();
80         }
81         jndiName = null;
82         if (jonasEjbRef != null) {
83             jndiName = jonasEjbRef.getJndiName();
84         }
85         this.home = ejbRef.getHome();
86         this.remote = ejbRef.getRemote();
87
88     }
89
90     /**
91      * Get the name of the ejb-ref
92      * @return String representation of the ejb-ref-name.
93      */

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

102     public String JavaDoc getEjbRefType() {
103         return ejbRefType;
104     }
105
106     /**
107      * Get the ejb-link
108      * @return String representation of the ejb-link
109      */

110     public String JavaDoc getEjbLink() {
111         return ejbLink;
112     }
113
114
115     /**
116      * Get the jndi name of the ejb-ref.
117      * @return String representation of the JNDI name
118      */

119     public String JavaDoc getJndiName() {
120         return jndiName;
121     }
122
123     /**
124      * Set the jndi name of the ejb-ref.
125      * @param jndiName representation of the JNDI name
126      */

127     public void setJndiName(String JavaDoc jndiName) {
128         this.jndiName = jndiName;
129     }
130
131
132     /**
133      * String representation of the object for test purpose
134      * @return String representation of this object
135      */

136     public String JavaDoc toString() {
137         StringBuffer JavaDoc ret = new StringBuffer JavaDoc();
138         ret.append("\ngetEjbRefName()=" + getEjbRefName());
139         ret.append("\ngetEjbRefType()=" + getEjbRefType());
140         ret.append("\ngetEjbLink()=" + getEjbLink());
141         ret.append("\ngetJndiName()=" + getJndiName());
142         return ret.toString();
143     }
144
145     /**
146      * @return the fully qualified name of the enterprise bean's home interface
147      */

148     public String JavaDoc getHome() {
149         return home;
150     }
151     /**
152      * @return the fully qualified name of the enterprise bean's remote interface
153      */

154     public String JavaDoc getRemote() {
155         return remote;
156     }
157 }
158
Popular Tags