KickJava   Java API By Example, From Geeks To Geeks.

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


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: AssemblyDescriptor.java,v 1.10 2004/05/19 21:18:56 ehardesty 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.MessageDestination;
32 import org.objectweb.jonas_lib.deployment.xml.SecurityRole;
33
34 /**
35  * This class defines the implementation of the element assembly-descriptor
36  *
37  * @author JOnAS team
38  */

39
40 public class AssemblyDescriptor extends AbsElement {
41
42     /**
43      * security-role
44      */

45     private JLinkedList securityRoleList = null;
46
47     /**
48      * method-permission
49      */

50     private JLinkedList methodPermissionList = null;
51
52     /**
53      * container-transaction
54      */

55     private JLinkedList containerTransactionList = null;
56
57     /**
58      * message-destination
59      */

60     private JLinkedList messageDestinationList = null;
61
62     /**
63      * exclude-list
64      */

65     private ExcludeList excludeList = null;
66
67
68     /**
69      * Constructor
70      */

71     public AssemblyDescriptor() {
72         super();
73         securityRoleList = new JLinkedList("security-role");
74         methodPermissionList = new JLinkedList("method-permission");
75         containerTransactionList = new JLinkedList("container-transaction");
76         messageDestinationList = new JLinkedList("message-destination");
77     }
78
79     /**
80      * Gets the security-role
81      * @return the security-role
82      */

83     public JLinkedList getSecurityRoleList() {
84         return securityRoleList;
85     }
86
87     /**
88      * Set the security-role
89      * @param securityRoleList securityRole
90      */

91     public void setSecurityRoleList(JLinkedList securityRoleList) {
92         this.securityRoleList = securityRoleList;
93     }
94
95     /**
96      * Add a new security-role element to this object
97      * @param securityRole the securityRoleobject
98      */

99     public void addSecurityRole(SecurityRole securityRole) {
100         securityRoleList.add(securityRole);
101     }
102
103     /**
104      * Gets the method-permission
105      * @return the method-permission
106      */

107     public JLinkedList getMethodPermissionList() {
108         return methodPermissionList;
109     }
110
111     /**
112      * Set the method-permission
113      * @param methodPermissionList methodPermission
114      */

115     public void setMethodPermissionList(JLinkedList methodPermissionList) {
116         this.methodPermissionList = methodPermissionList;
117     }
118
119     /**
120      * Add a new method-permission element to this object
121      * @param methodPermission the methodPermissionobject
122      */

123     public void addMethodPermission(MethodPermission methodPermission) {
124         methodPermissionList.add(methodPermission);
125     }
126
127     /**
128      * Gets the container-transaction
129      * @return the container-transaction
130      */

131     public JLinkedList getContainerTransactionList() {
132         return containerTransactionList;
133     }
134
135     /**
136      * Set the container-transaction
137      * @param containerTransactionList containerTransaction
138      */

139     public void setContainerTransactionList(JLinkedList containerTransactionList) {
140         this.containerTransactionList = containerTransactionList;
141     }
142
143     /**
144      * Add a new container-transaction element to this object
145      * @param containerTransaction the containerTransactionobject
146      */

147     public void addContainerTransaction(ContainerTransaction containerTransaction) {
148         containerTransactionList.add(containerTransaction);
149     }
150
151     /**
152      * Gets the message-destination
153      * @return the message-destination
154      */

155     public JLinkedList getMessageDestinationList() {
156         return messageDestinationList;
157     }
158
159     /**
160      * Set the message-destination
161      * @param messageDestinationList messageDestination
162      */

163     public void setMessageDestinationList(JLinkedList messageDestinationList) {
164         this.messageDestinationList = messageDestinationList;
165     }
166
167     /**
168      * Add a new message-destination element to this object
169      * @param messageDestination the messageDestinationobject
170      */

171     public void addMessageDestination(MessageDestination messageDestination) {
172         messageDestinationList.add(messageDestination);
173     }
174
175     /**
176      * Gets the exclude-list
177      * @return the exclude-list
178      */

179     public ExcludeList getExcludeList() {
180         return excludeList;
181     }
182
183     /**
184      * Set the exclude-list
185      * @param excludeList excludeList
186      */

187     public void setExcludeList(ExcludeList excludeList) {
188         this.excludeList = excludeList;
189     }
190
191     /**
192      * Represents this element by it's XML description.
193      * @param indent use this indent for prexifing XML representation.
194      * @return the XML description of this object.
195      */

196     public String JavaDoc toXML(int indent) {
197         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
198         sb.append(indent(indent));
199         sb.append("<assembly-descriptor>\n");
200
201         indent += 2;
202
203         // security-role
204
sb.append(securityRoleList.toXML(indent));
205         // method-permission
206
sb.append(methodPermissionList.toXML(indent));
207         // container-transaction
208
sb.append(containerTransactionList.toXML(indent));
209         // message-destination
210
sb.append(messageDestinationList.toXML(indent));
211         // exclude-list
212
if (excludeList != null) {
213             sb.append(excludeList.toXML(indent));
214         }
215         indent -= 2;
216         sb.append(indent(indent));
217         sb.append("</assembly-descriptor>\n");
218
219         return sb.toString();
220     }
221 }
222
Popular Tags