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: *
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation; either
010: * version 2.1 of the License, or 1any later version.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this library; if not, write to the Free Software
019: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
020: * USA
021: *
022: * Initial developer: Eric Hardesty
023: * --------------------------------------------------------------------------
024: * $Id: Messagelistener.java 3733 2003-11-20 17:04:08Z benoitf $
025: * --------------------------------------------------------------------------
026: */package org.objectweb.jonas_rar.deployment.xml;
027:
028: import org.objectweb.jonas_lib.deployment.xml.AbsElement;
029:
030: /**
031: * This class defines the implementation of the element messagelistener
032: *
033: * @author Eric Hardesty
034: */
035:
036: public class Messagelistener extends AbsElement {
037:
038: /**
039: * id
040: */
041: private String id = null;
042:
043: /**
044: * messagelistener-type
045: */
046: private String messagelistenerType = null;
047:
048: /**
049: * activationspec
050: */
051: private Activationspec activationspec = null;
052:
053: /**
054: * Constructor
055: */
056: public Messagelistener() {
057: super ();
058: }
059:
060: /**
061: * Gets the id
062: * @return the id
063: */
064: public String getId() {
065: return id;
066: }
067:
068: /**
069: * Set the id
070: * @param id id object
071: */
072: public void setId(String id) {
073: this .id = id;
074: }
075:
076: /**
077: * Gets the messagelistener-type
078: * @return the messagelistener-type
079: */
080: public String getMessagelistenerType() {
081: return messagelistenerType;
082: }
083:
084: /**
085: * Set the messagelistener-type
086: * @param messagelistenerType messagelistenerType
087: */
088: public void setMessagelistenerType(String messagelistenerType) {
089: this .messagelistenerType = messagelistenerType;
090: }
091:
092: /**
093: * Gets the activationspec
094: * @return the activationspec
095: */
096: public Activationspec getActivationspec() {
097: return activationspec;
098: }
099:
100: /**
101: * Set the activationspec
102: * @param activationspec activationspec
103: */
104: public void setActivationspec(Activationspec activationspec) {
105: this .activationspec = activationspec;
106: }
107:
108: /**
109: * Represents this element by it's XML description.
110: * @param indent use this indent for prefixing XML representation.
111: * @return the XML description of this object.
112: */
113: public String toXML(int indent) {
114: StringBuffer sb = new StringBuffer();
115: sb.append(indent(indent));
116: sb.append("<messagelistener");
117: sb.append(xmlAttribute(id, "id"));
118: sb.append(">\n");
119:
120: indent += 2;
121:
122: // messagelistener-type
123: sb.append(xmlElement(messagelistenerType,
124: "messagelistener-type", indent));
125: // activationspec
126: if (activationspec != null) {
127: sb.append(activationspec.toXML(indent));
128: }
129: indent -= 2;
130: sb.append(indent(indent));
131: sb.append("</messagelistener>\n");
132:
133: return sb.toString();
134: }
135: }
|