KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_lib > deployment > xml > AbsEnvironmentElement


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  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or 1any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * Initial developer: Florent BENOIT
22  * --------------------------------------------------------------------------
23  * $Id: AbsEnvironmentElement.java,v 1.5 2004/07/01 15:35:10 sauthieg Exp $
24  * --------------------------------------------------------------------------
25  */

26
27 package org.objectweb.jonas_lib.deployment.xml;
28
29 /**
30  * This class defines an abstract implementation for all environment element
31  *
32  * Entity, Session, WebApp, Application-client elements must extend this class
33  * @author Florent Benoit
34  */

35 public abstract class AbsEnvironmentElement extends AbsDescriptionElement implements JndiEnvRefsGroupXml {
36
37     /**
38      * List of ejb-local-ref
39      */

40     private JLinkedList ejbLocalRefList = null;
41
42     /**
43      * List of ejb-ref
44      */

45     private JLinkedList ejbRefList = null;
46
47     /**
48      * List of env-entry
49      */

50     private JLinkedList envEntryList = null;
51
52     /**
53      * List of resource-env-ref
54      */

55     private JLinkedList resourceEnvRefList = null;
56
57     /**
58      * List of resource-ref
59      */

60     private JLinkedList resourceRefList = null;
61
62
63     /**
64      * List of service-ref
65      */

66     private JLinkedList serviceRefList = null;
67
68     /**
69      * List of message-destination-ref
70      */

71     private JLinkedList messageDestinationRefList = null;
72
73
74
75
76     /**
77      * Constructor : build a new object for environment
78      */

79     public AbsEnvironmentElement() {
80         super();
81         ejbLocalRefList = new JLinkedList("ejb-local-ref");
82         ejbRefList = new JLinkedList("ejb-ref");
83         envEntryList = new JLinkedList("env-entry");
84         resourceEnvRefList = new JLinkedList("resource-env-ref");
85         resourceRefList = new JLinkedList("resource-ref");
86         serviceRefList = new JLinkedList("service-ref");
87         messageDestinationRefList = new JLinkedList("message-destination-ref");
88     }
89
90
91
92     // Setters
93

94     /**
95      * Add a new ejb-local-ref element to this object
96      * @param ejbLocalRef the ejb-local-ref object
97      */

98     public void addEjbLocalRef(EjbLocalRef ejbLocalRef) {
99         ejbLocalRefList.add(ejbLocalRef);
100     }
101
102
103     /**
104      * Add a new ejb-ref element to this object
105      * @param ejbRef the ejb-ref object
106      */

107     public void addEjbRef(EjbRef ejbRef) {
108         ejbRefList.add(ejbRef);
109     }
110
111     /**
112      * Add a new env-entry element to this object
113      * @param envEntry the ejb-ref object
114      */

115     public void addEnvEntry(EnvEntry envEntry) {
116         envEntryList.add(envEntry);
117     }
118
119     /**
120      * Add a new resource-env-ref element to this object
121      * @param resourceEnvRef the resource-env-ref object
122      */

123     public void addResourceEnvRef(ResourceEnvRef resourceEnvRef) {
124         resourceEnvRefList.add(resourceEnvRef);
125     }
126
127     /**
128      * Add a new resource-ref element to this object
129      * @param resourceRef the resource-ref object
130      */

131     public void addResourceRef(ResourceRef resourceRef) {
132         resourceRefList.add(resourceRef);
133     }
134
135
136     /**
137      * Add a new service-ref element to this object
138      * @param serviceRef the service-ref object
139      */

140     public void addServiceRef(ServiceRef serviceRef) {
141         serviceRefList.add(serviceRef);
142     }
143
144     /**
145      * Add a new message-destination-ref element to this object
146      * @param messageDestinationRef the message-destination-ref object
147      */

148     public void addMessageDestinationRef(MessageDestinationRef messageDestinationRef) {
149         messageDestinationRefList.add(messageDestinationRef);
150     }
151
152
153
154
155     // Getters
156

157     /**
158      * @return the list of all ejb-local-ref elements
159      */

160     public JLinkedList getEjbLocalRefList() {
161         return ejbLocalRefList;
162     }
163
164     /**
165      * @return the list of all ejb-ref elements
166      */

167     public JLinkedList getEjbRefList() {
168         return ejbRefList;
169     }
170
171     /**
172      * @return the list of all env-entry elements
173      */

174     public JLinkedList getEnvEntryList() {
175         return envEntryList;
176     }
177
178     /**
179      * @return the list of all resource-env-ref elements
180      */

181     public JLinkedList getResourceEnvRefList() {
182         return resourceEnvRefList;
183     }
184
185
186     /**
187      * @return the list of all resource-ref elements
188      */

189     public JLinkedList getResourceRefList() {
190         return resourceRefList;
191     }
192
193
194     /**
195      * @return the list of all service-ref elements
196      */

197     public JLinkedList getServiceRefList() {
198         return serviceRefList;
199     }
200
201     /**
202      * @return the list of all messageDestination-ref elements
203      */

204     public JLinkedList getMessageDestinationRefList() {
205         return messageDestinationRefList;
206     }
207
208 }
209
Popular Tags