001: /**
002: * EasyBeans
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: easybeans@ow2.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: AbsEnvironment.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.deployment.xml.struct.common;
025:
026: import java.util.ArrayList;
027: import java.util.List;
028:
029: /**
030: * This class defines an implementation for an environment element.
031: * @author Florent Benoit
032: */
033: public class AbsEnvironment {
034:
035: /**
036: * List of <env-entry> elements.
037: */
038: private List<EnvEntry> envEntryList = null;
039:
040: /**
041: * List of <ejb-ref> elements.
042: */
043: private List<EJBRef> ejbRefList = null;
044:
045: /**
046: * List of <ejb-local-ref> elements.
047: */
048: private List<EJBLocalRef> ejbLocalRefList = null;
049:
050: /**
051: * List of <resource-ref> elements.
052: */
053: private List<ResourceRef> resourceRefList = null;
054:
055: /**
056: * List of <resource-env-ref> elements.
057: */
058: private List<ResourceEnvRef> resourceEnvRefList = null;
059:
060: /**
061: * List of <message-destination-ref> elements.
062: */
063: private List<MessageDestinationRef> messageDestinationRefList = null;
064:
065: /**
066: * List of <around-invoke> elements.
067: */
068: private List<AroundInvoke> aroundInvokeList = null;
069:
070: /**
071: * List of <post-activate> elements.
072: */
073: private List<LifeCycleCallback> postActivateList = null;
074:
075: /**
076: * List of <pre-passivate> elements.
077: */
078: private List<LifeCycleCallback> prePassivateList = null;
079:
080: /**
081: * List of <post-construct> elements.
082: */
083: private List<LifeCycleCallback> postConstructList = null;
084:
085: /**
086: * List of <pre-destroy> elements.
087: */
088: private List<LifeCycleCallback> preDestroyList = null;
089:
090: /**
091: * Constructor : build a new object for environment.
092: */
093: public AbsEnvironment() {
094: this .envEntryList = new ArrayList<EnvEntry>();
095: this .ejbRefList = new ArrayList<EJBRef>();
096: this .ejbLocalRefList = new ArrayList<EJBLocalRef>();
097: this .resourceRefList = new ArrayList<ResourceRef>();
098: this .resourceEnvRefList = new ArrayList<ResourceEnvRef>();
099: this .messageDestinationRefList = new ArrayList<MessageDestinationRef>();
100: this .aroundInvokeList = new ArrayList<AroundInvoke>();
101: this .postActivateList = new ArrayList<LifeCycleCallback>();
102: this .postConstructList = new ArrayList<LifeCycleCallback>();
103: this .preDestroyList = new ArrayList<LifeCycleCallback>();
104: this .prePassivateList = new ArrayList<LifeCycleCallback>();
105: }
106:
107: /**
108: * Add a new env-entry element to this object.
109: * @param envEntry the ejb-ref object
110: */
111: public void addEnvEntry(final EnvEntry envEntry) {
112: envEntryList.add(envEntry);
113: }
114:
115: /**
116: * @return the list of all env-entry elements
117: */
118: public List<EnvEntry> getEnvEntryList() {
119: return envEntryList;
120: }
121:
122: /**
123: * Gets the list of <around-invoke> elements.
124: * @return list of <around-invoke> elements.
125: */
126: public List<AroundInvoke> getAroundInvokeList() {
127: return aroundInvokeList;
128: }
129:
130: /**
131: * Adds a new <around-invoke> element to assembly descriptor.
132: * @param aroundInvoke the <around-invoke> element
133: */
134: public void addAroundInvoke(final AroundInvoke aroundInvoke) {
135: aroundInvokeList.add(aroundInvoke);
136: }
137:
138: /**
139: * Gets the list of <post-construct> elements.
140: * @return list of <post-construct> elements.
141: */
142: public List<LifeCycleCallback> getPostConstructCallbackList() {
143: return postConstructList;
144: }
145:
146: /**
147: * Adds a new <post-construct> element to assembly descriptor.
148: * @param postConstructCallback the <post-construct> element
149: */
150: public void addPostConstructCallback(
151: final LifeCycleCallback postConstructCallback) {
152: postConstructList.add(postConstructCallback);
153: }
154:
155: /**
156: * Gets the list of <post-activate> elements.
157: * @return list of <post-activate> elements.
158: */
159: public List<LifeCycleCallback> getPostActivateCallbackList() {
160: return postActivateList;
161: }
162:
163: /**
164: * Adds a new <post-activate> element to assembly descriptor.
165: * @param postActivateCallback the <post-activate> element
166: */
167: public void addPostActivateCallback(
168: final LifeCycleCallback postActivateCallback) {
169: postActivateList.add(postActivateCallback);
170: }
171:
172: /**
173: * Gets the list of <pre-destroy> elements.
174: * @return list of <pre-destroy> elements.
175: */
176: public List<LifeCycleCallback> getPreDestroyCallbackList() {
177: return preDestroyList;
178: }
179:
180: /**
181: * Adds a new <pre-destroy> element to assembly descriptor.
182: * @param preDestroyCallback the <pre-destroy> element
183: */
184: public void addPreDestroyCallback(
185: final LifeCycleCallback preDestroyCallback) {
186: preDestroyList.add(preDestroyCallback);
187: }
188:
189: /**
190: * Gets the list of <pre-passivate> elements.
191: * @return list of <pre-passivate> elements.
192: */
193: public List<LifeCycleCallback> getPrePassivateCallbackList() {
194: return prePassivateList;
195: }
196:
197: /**
198: * Adds a new <pre-passivate> element to assembly descriptor.
199: * @param prePassivateCallback the <pre-passivate> element
200: */
201: public void addPrePassivateCallback(
202: final LifeCycleCallback prePassivateCallback) {
203: prePassivateList.add(prePassivateCallback);
204: }
205:
206: /**
207: * Gets the list of <ejb-ref> elements.
208: * @return list of <ejb-ref> elements.
209: */
210: public List<EJBRef> getEJBRefList() {
211: return ejbRefList;
212: }
213:
214: /**
215: * Adds a new <ejb-ref> element.
216: * @param ejbRef the <ejb-ref> element
217: */
218: public void addEJBRef(final EJBRef ejbRef) {
219: ejbRefList.add(ejbRef);
220: }
221:
222: /**
223: * Gets the list of <resource-ref> elements.
224: * @return list of <resource-ref> elements.
225: */
226: public List<ResourceRef> getResourceRefList() {
227: return resourceRefList;
228: }
229:
230: /**
231: * Adds a new <resource-ref> element.
232: * @param resourceRef the <resource-ref> element
233: */
234: public void addResourceRef(final ResourceRef resourceRef) {
235: resourceRefList.add(resourceRef);
236: }
237:
238: /**
239: * Gets the list of <message-destination-ref> elements.
240: * @return list of <message-destination-ref> elements.
241: */
242: public List<MessageDestinationRef> getMessageDestinationRefList() {
243: return messageDestinationRefList;
244: }
245:
246: /**
247: * Adds a new <message-destination-ref> element.
248: * @param messageDestinationRef the <message-destination-ref> element
249: */
250: public void addMessageDestinationRef(
251: final MessageDestinationRef messageDestinationRef) {
252: messageDestinationRefList.add(messageDestinationRef);
253: }
254:
255: /**
256: * Gets the list of <resource-env-ref> elements.
257: * @return list of <resource-env-ref> elements.
258: */
259: public List<ResourceEnvRef> getResourceEnvRefList() {
260: return resourceEnvRefList;
261: }
262:
263: /**
264: * Adds a new <resource-ref> element.
265: * @param resourceEnvRef the <resource-ref> element
266: */
267: public void addResourceEnvRef(final ResourceEnvRef resourceEnvRef) {
268: resourceEnvRefList.add(resourceEnvRef);
269: }
270:
271: /**
272: * Gets the list of <ejb-local-ref> elements.
273: * @return list of <ejb-local-ref> elements.
274: */
275: public List<EJBLocalRef> getEJBLocalRefList() {
276: return ejbLocalRefList;
277: }
278:
279: /**
280: * Adds a new <ejb-local-ref> element.
281: * @param ejLocalRef the <ejb-local-ref> element
282: */
283: public void addEJBLocalRef(final EJBLocalRef ejLocalRef) {
284: ejbLocalRefList.add(ejLocalRef);
285: }
286: }
|