KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_ejb > deployment > xml > JonasEjbJar


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: JonasEjbJar.java,v 1.11 2004/07/22 11:37:08 benoitf Exp $
25  * --------------------------------------------------------------------------
26  */

27 package org.objectweb.jonas_ejb.deployment.xml;
28
29 import org.objectweb.jonas_lib.deployment.xml.AbsElement;
30 import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
31 import org.objectweb.jonas_lib.deployment.xml.JonasMessageDestination;
32 import org.objectweb.jonas_lib.deployment.xml.TopLevelElement;
33
34 /**
35  * This class defines the implementation of the element jonas-ejb-jar
36  *
37  * @author JOnAS team
38  */

39
40 public class JonasEjbJar extends AbsElement implements TopLevelElement {
41
42     /**
43      * Header (with right XSD version) for XML
44      */

45     private String JavaDoc header = null;
46
47     /**
48      * jonas-session
49      */

50     private JLinkedList jonasSessionList = null;
51
52     /**
53      * jonas-entity
54      */

55     private JLinkedList jonasEntityList = null;
56
57     /**
58      * jonas-message-driven
59      */

60     private JLinkedList jonasMessageDrivenList = null;
61
62     /**
63      * jonas-ejb-relation
64      */

65     private JLinkedList jonasEjbRelationList = null;
66
67     /**
68      * jonas-message-destination
69      */

70     private JLinkedList jonasMessageDestinationList = null;
71
72     /**
73      * jonas-run-as-mapping
74      */

75     private JLinkedList jonasRunAsMappingList = null;
76
77
78     /**
79      * Constructor
80      */

81     public JonasEjbJar() {
82         super();
83         jonasSessionList = new JLinkedList("jonas-session");
84         jonasEntityList = new JLinkedList("jonas-entity");
85         jonasMessageDrivenList = new JLinkedList("jonas-message-driven");
86         jonasEjbRelationList = new JLinkedList("jonas-ejb-relation");
87         jonasMessageDestinationList = new JLinkedList("jonas-message-destination");
88         jonasRunAsMappingList = new JLinkedList("jonas-run-as-mapping");
89     }
90
91     /**
92      * Gets the jonas-run-as-mapping
93      * @return the jonas-run-as-mapping
94      */

95     public JLinkedList getJonasRunAsMappingList() {
96         return jonasRunAsMappingList;
97     }
98
99     /**
100      * Gets the jonas-session
101      * @return the jonas-session
102      */

103     public JLinkedList getJonasSessionList() {
104         return jonasSessionList;
105     }
106
107     /**
108      * Set the jonas-session
109      * @param jonasSessionList jonasSession
110      */

111     public void setJonasSessionList(JLinkedList jonasSessionList) {
112         this.jonasSessionList = jonasSessionList;
113     }
114
115     /**
116      * Add a new jonas-run-as-mapping element to this object
117      * @param jonasRunAsMapping the jonasRunAsMapping object
118      */

119     public void addJonasRunAsMapping(JonasRunAsMapping jonasRunAsMapping) {
120         jonasRunAsMappingList.add(jonasRunAsMapping);
121     }
122
123     /**
124      * Add a new jonas-session element to this object
125      * @param jonasSession the jonasSessionobject
126      */

127     public void addJonasSession(JonasSession jonasSession) {
128         jonasSessionList.add(jonasSession);
129     }
130
131     /**
132      * Gets the jonas-entity
133      * @return the jonas-entity
134      */

135     public JLinkedList getJonasEntityList() {
136         return jonasEntityList;
137     }
138
139     /**
140      * Set the jonas-entity
141      * @param jonasEntityList jonasEntity
142      */

143     public void setJonasEntityList(JLinkedList jonasEntityList) {
144         this.jonasEntityList = jonasEntityList;
145     }
146
147     /**
148      * Add a new jonas-entity element to this object
149      * @param jonasEntity the jonasEntityobject
150      */

151     public void addJonasEntity(JonasEntity jonasEntity) {
152         jonasEntityList.add(jonasEntity);
153     }
154
155     /**
156      * Gets the jonas-message-driven
157      * @return the jonas-message-driven
158      */

159     public JLinkedList getJonasMessageDrivenList() {
160         return jonasMessageDrivenList;
161     }
162
163     /**
164      * Set the jonas-message-driven
165      * @param jonasMessageDrivenList jonasMessageDriven
166      */

167     public void setJonasMessageDrivenList(JLinkedList jonasMessageDrivenList) {
168         this.jonasMessageDrivenList = jonasMessageDrivenList;
169     }
170
171     /**
172      * Add a new jonas-message-driven element to this object
173      * @param jonasMessageDriven the jonasMessageDrivenobject
174      */

175     public void addJonasMessageDriven(JonasMessageDriven jonasMessageDriven) {
176         jonasMessageDrivenList.add(jonasMessageDriven);
177     }
178
179     /**
180      * Gets the jonas-ejb-relation
181      * @return the jonas-ejb-relation
182      */

183     public JLinkedList getJonasEjbRelationList() {
184         return jonasEjbRelationList;
185     }
186
187     /**
188      * Set the jonas-ejb-relation
189      * @param jonasEjbRelationList jonasEjbRelation
190      */

191     public void setJonasEjbRelationList(JLinkedList jonasEjbRelationList) {
192         this.jonasEjbRelationList = jonasEjbRelationList;
193     }
194
195     /**
196      * Add a new jonas-ejb-relation element to this object
197      * @param jonasEjbRelation the jonasEjbRelationobject
198      */

199     public void addJonasEjbRelation(JonasEjbRelation jonasEjbRelation) {
200         jonasEjbRelationList.add(jonasEjbRelation);
201     }
202
203     /**
204      * @return the list of all jonas-message-destination elements
205      */

206     public JLinkedList getJonasMessageDestinationList() {
207         return jonasMessageDestinationList;
208     }
209
210     /**
211      * Set the jonas-message-destination
212      * @param jonasMessageDestinationList jonasMessageDestination
213      */

214     public void setJonasMessageDestinationList(JLinkedList jonasMessageDestinationList) {
215         this.jonasMessageDestinationList = jonasMessageDestinationList;
216     }
217
218     /**
219      * Add a new jonas-message-destination element to this object
220      * @param jonasMessageDestination the jonas-message-destination object
221      */

222     public void addJonasMessageDestination(JonasMessageDestination jonasMessageDestination) {
223         jonasMessageDestinationList.add(jonasMessageDestination);
224     }
225
226     /**
227      * Represents this element by it's XML description.
228      * @param indent use this indent for prexifing XML representation.
229      * @return the XML description of this object.
230      */

231     public String JavaDoc toXML(int indent) {
232         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
233         sb.append(indent(indent));
234         if (header != null) {
235             sb.append(header);
236         } else {
237             sb.append("<jonas-ejb-jar>");
238         }
239
240         indent += 2;
241
242         // jonas-session
243
sb.append(jonasSessionList.toXML(indent));
244         // jonas-entity
245
sb.append(jonasEntityList.toXML(indent));
246         // jonas-message-driven
247
sb.append(jonasMessageDrivenList.toXML(indent));
248         // jonas-ejb-relation
249
sb.append(jonasEjbRelationList.toXML(indent));
250         // jonas-message-destination
251
sb.append(jonasMessageDestinationList.toXML(indent));
252         // jonas-run-as-mapping
253
sb.append(jonasRunAsMappingList.toXML(indent));
254         indent -= 2;
255         sb.append(indent(indent));
256         sb.append("</jonas-ejb-jar>\n");
257
258         return sb.toString();
259     }
260
261     /**
262      * @return the header.
263      */

264     public String JavaDoc getHeader() {
265         return header;
266     }
267
268     /**
269      * @param header The header to set.
270      */

271     public void setHeader(String JavaDoc header) {
272         this.header = header;
273     }
274 }
275
Popular Tags