KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_client > deployment > xml > ApplicationClient


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  *
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or 1any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20  * USA
21  *
22  * Initial developer: jonas-team
23  * --------------------------------------------------------------------------
24  * $Id: ApplicationClient.java,v 1.6 2004/05/19 21:08:57 ehardesty Exp $
25  * --------------------------------------------------------------------------
26  */

27 package org.objectweb.jonas_client.deployment.xml;
28
29 // Import jonas_lib
30
import org.objectweb.jonas_lib.deployment.xml.AbsEnvironmentElement;
31 import org.objectweb.jonas_lib.deployment.xml.JndiEnvRefsGroupXml;
32 import org.objectweb.jonas_lib.deployment.xml.TopLevelElement;
33
34 /**
35  * This class defines the implementation of the element application-client
36  * @author jonas-team
37  */

38
39 public class ApplicationClient extends AbsEnvironmentElement implements TopLevelElement, JndiEnvRefsGroupXml {
40
41     /**
42      * callback-handler
43      */

44     private String JavaDoc callbackHandler = null;
45
46     /**
47      * Constructor
48      */

49     public ApplicationClient() {
50         super();
51     }
52
53     /**
54      * @return the callback-handler
55      */

56     public String JavaDoc getCallbackHandler() {
57         return callbackHandler;
58     }
59
60     /**
61      * Set the callback-handler
62      * @param callbackHandler callbackHandler
63      */

64     public void setCallbackHandler(String JavaDoc callbackHandler) {
65         this.callbackHandler = callbackHandler;
66     }
67
68     /**
69      * Represents this element by it's XML description.
70      * @param indent use this indent for prexifing XML representation.
71      * @return the XML description of this object.
72      */

73     public String JavaDoc toXML(int indent) {
74         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
75         sb.append(indent(indent));
76         sb.append("<application-client>\n");
77
78         indent += 2;
79
80         // icon
81
sb.append(getIcon().toXML(indent));
82         // display-name
83
sb.append(xmlElement(getDisplayName(), "display-name", indent));
84         // description
85
sb.append(xmlElement(getDescription(), "description", indent));
86         // env-entry
87
sb.append(getEnvEntryList().toXML(indent));
88         // ejb-ref
89
sb.append(getEjbRefList().toXML(indent));
90         // service-ref
91
sb.append(getServiceRefList().toXML(indent));
92         // resource-ref
93
sb.append(getResourceRefList().toXML(indent));
94         // resource-env-ref
95
sb.append(getResourceEnvRefList().toXML(indent));
96         // message-destination-ref
97
sb.append(getMessageDestinationRefList().toXML(indent));
98         // callback-handler
99
sb.append(xmlElement(callbackHandler, "callback-handler", indent));
100         indent -= 2;
101         sb.append(indent(indent));
102         sb.append("</application-client>\n");
103
104         return sb.toString();
105     }
106
107 }
Popular Tags