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: Florent BENOIT
022: * --------------------------------------------------------------------------
023: * $Id: JonasEjbRef.java 4718 2004-05-10 12:06:09Z sauthieg $
024: * --------------------------------------------------------------------------
025: */package org.objectweb.jonas_lib.deployment.xml;
026:
027: /**
028: * This class defines the implementation of the element jonas-ejb-ref.
029: * @author Florent Benoit
030: */
031: public class JonasEjbRef extends AbsElement {
032:
033: /**
034: * Name of this jonas-ejb-ref
035: */
036: private String ejbRefName = null;
037:
038: /**
039: * jndi name of this jonas-ejb-ref
040: */
041: private String jndiName = null;
042:
043: // Setters
044:
045: /**
046: * Sets the name
047: * @param ejbRefName the name to use
048: */
049: public void setEjbRefName(String ejbRefName) {
050: this .ejbRefName = ejbRefName;
051: }
052:
053: /**
054: * Sets the jndi name
055: * @param jndiName the jndi-name to use
056: */
057: public void setJndiName(String jndiName) {
058: this .jndiName = jndiName;
059: }
060:
061: // Getters
062:
063: /**
064: * @return the name of the jonas-ejb-ref
065: */
066: public String getEjbRefName() {
067: return ejbRefName;
068: }
069:
070: /**
071: * @return the jndi-name of the jonas-ejb-ref
072: */
073: public String getJndiName() {
074: return jndiName;
075: }
076:
077: /**
078: * Represents this element by it's XML description.
079: * @param indent use this indent for prexifing XML representation.
080: * @return the XML description of this object.
081: */
082: public String toXML(int indent) {
083: StringBuffer sb = new StringBuffer();
084: sb.append(indent(indent));
085: sb.append("<jonas-ejb-ref>\n");
086:
087: indent += 2;
088:
089: // name
090: sb.append(xmlElement(ejbRefName, "ejb-ref-name", indent));
091:
092: // jndi-name
093: sb.append(xmlElement(jndiName, "jndi-name", indent));
094:
095: indent -= 2;
096: sb.append(indent(indent));
097: sb.append("</jonas-ejb-ref>\n");
098:
099: return sb.toString();
100: }
101:
102: }
|