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 1any 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: Christophe Ney
022: * --------------------------------------------------------------------------
023: * $Id: EjbLocalRefDesc.java 4729 2004-05-11 08:07:50Z sauthieg $
024: * --------------------------------------------------------------------------
025: */package org.objectweb.jonas_lib.deployment.api;
026:
027: import org.objectweb.jonas_lib.deployment.xml.EjbLocalRef;
028:
029: /**
030: * This class represents the description of an EjblocalRef object
031: * @author Christophe Ney
032: * @author Florent Benoit
033: */
034: public class EjbLocalRefDesc {
035:
036: /**
037: * The ejb local ref name.
038: */
039: private String ejbRefName = null;
040:
041: /**
042: * The type of the ejb ref
043: */
044: private String ejbRefType = null;
045:
046: /**
047: * The local home of the ejb local ref.
048: */
049: private String localHome = null;
050:
051: /**
052: * The local interface name of the ejb local ref.
053: */
054: private String local = null;
055:
056: /**
057: * The ejb link of the ejb local ref.
058: */
059: private String ejbLink = null;
060:
061: /**
062: * The jndi name of the ejb local ref.
063: */
064: private String jndiName = null;
065:
066: /**
067: * Construct a descriptor for an ejb-local-ref tag.
068: * @param ejbLocalRef the ejb local ref resulting of the xml parsing.
069: * @throws DeploymentDescException when missing information for
070: * creating the EjbLocalRefDesc.
071: */
072: public EjbLocalRefDesc(EjbLocalRef ejbLocalRef)
073: throws DeploymentDescException {
074: ejbRefName = ejbLocalRef.getEjbRefName();
075: ejbRefType = ejbLocalRef.getEjbRefType();
076: localHome = ejbLocalRef.getLocalHome();
077: local = ejbLocalRef.getLocal();
078: if (ejbLocalRef.getEjbLink() == null) {
079: String err = "ejb-link missing for ejb-local-ref '"
080: + ejbRefName + "'.";
081: throw new DeploymentDescException(err);
082: }
083: ejbLink = ejbLocalRef.getEjbLink();
084: }
085:
086: /**
087: * Get the name of the ejb-ref
088: * @return String representation of the ejb-ref-name.
089: */
090: public String getEjbRefName() {
091: return ejbRefName;
092: }
093:
094: /**
095: * Get the ejb-ref-type.
096: * @return String representation of the ejb-ref-type.
097: */
098: public String getEjbRefType() {
099: return ejbRefType;
100: }
101:
102: /**
103: * Get the LocalHome class of the target bean
104: * @return String representation of the class.
105: */
106: public String getLocalHome() {
107: return localHome;
108: }
109:
110: /**
111: * Get the Local class of the target bean
112: * @return String representation of the class.
113: */
114: public String getLocal() {
115: return local;
116: }
117:
118: /**
119: * Get the ejb-link
120: * @return String representation of the ejb-link
121: */
122: public String getEjbLink() {
123: return ejbLink;
124: }
125:
126: /**
127: * Get the jndi name of the ejb-local-ref.
128: * @return the string representation of the JNDI name
129: */
130: public String getJndiLocalName() {
131: return jndiName;
132: }
133:
134: /**
135: * Set the jndi name of the ejb-local-ref.
136: * @param jndiName the string representation of the jndi name.
137: */
138: public void setJndiLocalName(String jndiName) {
139: this .jndiName = jndiName;
140: }
141:
142: /**
143: * String representation of the object for test purpose
144: * @return String representation of this object
145: */
146: public String toString() {
147: StringBuffer ret = new StringBuffer();
148: ret.append("\ngetEjbRefName()=" + getEjbRefName());
149: ret.append("\ngetEjbRefType()=" + getEjbRefType());
150: ret.append("\ngetLocalHome()=" + getLocalHome());
151: ret.append("\ngetLocal()=" + getLocal());
152: ret.append("\ngetEjbLink()=" + getEjbLink());
153: ret.append("\ngetJndiLocalName()=" + getJndiLocalName());
154: return ret.toString();
155: }
156:
157: }
|