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: JonasResourceEnv.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-resource-env.
029: * @author Florent Benoit
030: */
031: public class JonasResourceEnv extends AbsElement {
032:
033: /**
034: * Name of this jonas-resource-env
035: */
036: private String resourceEnvRefName = null;
037:
038: /**
039: * jndi name of this jonas-resource-env
040: */
041: private String jndiName = null;
042:
043: // Setters
044:
045: /**
046: * Sets the name
047: * @param resourceEnvRefName the name to use
048: */
049: public void setResourceEnvRefName(String resourceEnvRefName) {
050: this .resourceEnvRefName = resourceEnvRefName;
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-resource-env
065: */
066: public String getResourceEnvRefName() {
067: return resourceEnvRefName;
068: }
069:
070: /**
071: * @return the jndi-name of the jonas-resource-env
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-resource-env>\n");
086:
087: indent += 2;
088:
089: // name
090: sb.append(xmlElement(resourceEnvRefName,
091: "resource-env-ref-name", indent));
092:
093: // jndi-name
094: sb.append(xmlElement(jndiName, "jndi-name", indent));
095:
096: indent -= 2;
097: sb.append(indent(indent));
098: sb.append("</jonas-resource-env>\n");
099:
100: return sb.toString();
101: }
102:
103: }
|