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: jonas-team
023: * --------------------------------------------------------------------------
024: * $Id: ApplicationClient.java 4780 2004-05-19 21:10:21Z ehardesty $
025: * --------------------------------------------------------------------------
026: */package org.objectweb.jonas_client.deployment.xml;
027:
028: // Import jonas_lib
029: import org.objectweb.jonas_lib.deployment.xml.AbsEnvironmentElement;
030: import org.objectweb.jonas_lib.deployment.xml.JndiEnvRefsGroupXml;
031: import org.objectweb.jonas_lib.deployment.xml.TopLevelElement;
032:
033: /**
034: * This class defines the implementation of the element application-client
035: * @author jonas-team
036: */
037:
038: public class ApplicationClient extends AbsEnvironmentElement implements
039: TopLevelElement, JndiEnvRefsGroupXml {
040:
041: /**
042: * callback-handler
043: */
044: private String callbackHandler = null;
045:
046: /**
047: * Constructor
048: */
049: public ApplicationClient() {
050: super ();
051: }
052:
053: /**
054: * @return the callback-handler
055: */
056: public String getCallbackHandler() {
057: return callbackHandler;
058: }
059:
060: /**
061: * Set the callback-handler
062: * @param callbackHandler callbackHandler
063: */
064: public void setCallbackHandler(String callbackHandler) {
065: this .callbackHandler = callbackHandler;
066: }
067:
068: /**
069: * Represents this element by it's XML description.
070: * @param indent use this indent for prexifing XML representation.
071: * @return the XML description of this object.
072: */
073: public String toXML(int indent) {
074: StringBuffer sb = new StringBuffer();
075: sb.append(indent(indent));
076: sb.append("<application-client>\n");
077:
078: indent += 2;
079:
080: // icon
081: sb.append(getIcon().toXML(indent));
082: // display-name
083: sb.append(xmlElement(getDisplayName(), "display-name", indent));
084: // description
085: sb.append(xmlElement(getDescription(), "description", indent));
086: // env-entry
087: sb.append(getEnvEntryList().toXML(indent));
088: // ejb-ref
089: sb.append(getEjbRefList().toXML(indent));
090: // service-ref
091: sb.append(getServiceRefList().toXML(indent));
092: // resource-ref
093: sb.append(getResourceRefList().toXML(indent));
094: // resource-env-ref
095: sb.append(getResourceEnvRefList().toXML(indent));
096: // message-destination-ref
097: sb.append(getMessageDestinationRefList().toXML(indent));
098: // callback-handler
099: sb.append(xmlElement(callbackHandler, "callback-handler",
100: indent));
101: indent -= 2;
102: sb.append(indent(indent));
103: sb.append("</application-client>\n");
104:
105: return sb.toString();
106: }
107:
108: }
|