KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_rar > deployment > xml > Messagelistener


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: Eric Hardesty
23  * --------------------------------------------------------------------------
24  * $Id: Messagelistener.java,v 1.2 2003/11/20 17:04:08 benoitf Exp $
25  * --------------------------------------------------------------------------
26  */

27 package org.objectweb.jonas_rar.deployment.xml;
28
29 import org.objectweb.jonas_lib.deployment.xml.AbsElement;
30
31 /**
32  * This class defines the implementation of the element messagelistener
33  *
34  * @author Eric Hardesty
35  */

36
37 public class Messagelistener extends AbsElement {
38
39     /**
40      * id
41      */

42     private String JavaDoc id = null;
43
44     /**
45      * messagelistener-type
46      */

47     private String JavaDoc messagelistenerType = null;
48
49     /**
50      * activationspec
51      */

52     private Activationspec activationspec = null;
53
54
55     /**
56      * Constructor
57      */

58     public Messagelistener() {
59         super();
60     }
61
62     /**
63      * Gets the id
64      * @return the id
65      */

66     public String JavaDoc getId() {
67         return id;
68     }
69
70     /**
71      * Set the id
72      * @param id id object
73      */

74     public void setId(String JavaDoc id) {
75         this.id = id;
76     }
77
78     /**
79      * Gets the messagelistener-type
80      * @return the messagelistener-type
81      */

82     public String JavaDoc getMessagelistenerType() {
83         return messagelistenerType;
84     }
85
86     /**
87      * Set the messagelistener-type
88      * @param messagelistenerType messagelistenerType
89      */

90     public void setMessagelistenerType(String JavaDoc messagelistenerType) {
91         this.messagelistenerType = messagelistenerType;
92     }
93
94     /**
95      * Gets the activationspec
96      * @return the activationspec
97      */

98     public Activationspec getActivationspec() {
99         return activationspec;
100     }
101
102     /**
103      * Set the activationspec
104      * @param activationspec activationspec
105      */

106     public void setActivationspec(Activationspec activationspec) {
107         this.activationspec = activationspec;
108     }
109
110     /**
111      * Represents this element by it's XML description.
112      * @param indent use this indent for prefixing XML representation.
113      * @return the XML description of this object.
114      */

115     public String JavaDoc toXML(int indent) {
116         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
117         sb.append(indent(indent));
118         sb.append("<messagelistener");
119         sb.append(xmlAttribute(id, "id"));
120         sb.append(">\n");
121
122         indent += 2;
123
124         // messagelistener-type
125
sb.append(xmlElement(messagelistenerType, "messagelistener-type", indent));
126         // activationspec
127
if (activationspec != null) {
128           sb.append(activationspec.toXML(indent));
129         }
130         indent -= 2;
131         sb.append(indent(indent));
132         sb.append("</messagelistener>\n");
133
134         return sb.toString();
135     }
136 }
137
Popular Tags