KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > deployment > xml > struct > common > AbsEnvironment


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@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 any 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  * --------------------------------------------------------------------------
22  * $Id: AbsEnvironment.java 503 2006-05-24 13:44:31Z benoitf $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.easybeans.deployment.xml.struct.common;
27
28 import java.util.ArrayList JavaDoc;
29 import java.util.List JavaDoc;
30
31 import org.objectweb.easybeans.deployment.xml.struct.LifeCycleCallback;
32
33 /**
34  * This class defines an implementation for an environment element.
35  * @author Florent Benoit
36  */

37 public class AbsEnvironment {
38
39     /**
40      * List of <env-entry> elements.
41      */

42     private List JavaDoc<EnvEntry> envEntryList = null;
43
44     /**
45      * List of &lt;post-construct&gt; elements.
46      */

47     private List JavaDoc<LifeCycleCallback> postConstructList = null;
48
49
50     /**
51      * List of &lt;pre-destroy&gt; elements.
52      */

53     private List JavaDoc<LifeCycleCallback> preDestroyList = null;
54
55     /**
56      * Constructor : build a new object for environment.
57      */

58     public AbsEnvironment() {
59         envEntryList = new ArrayList JavaDoc<EnvEntry>();
60         postConstructList = new ArrayList JavaDoc<LifeCycleCallback>();
61         preDestroyList = new ArrayList JavaDoc<LifeCycleCallback>();
62     }
63
64     /**
65      * Add a new env-entry element to this object.
66      * @param envEntry the ejb-ref object
67      */

68     public void addEnvEntry(final EnvEntry envEntry) {
69         envEntryList.add(envEntry);
70     }
71
72     /**
73      * @return the list of all env-entry elements
74      */

75     public List JavaDoc<EnvEntry> getEnvEntryList() {
76         return envEntryList;
77     }
78
79     /**
80      * Add a new postConstruct element to this object.
81      * @param postConstruct the post-construct object
82      */

83     public void addPostConstruct(final LifeCycleCallback postConstruct) {
84         postConstructList.add(postConstruct);
85     }
86
87     /**
88      * @return the list of all post-construct elements
89      */

90     public List JavaDoc<LifeCycleCallback> getPostConstructList() {
91         return postConstructList;
92     }
93
94     /**
95      * Add a new preDestroy element to this object.
96      * @param preDestroy the pre-destroy object
97      */

98     public void addPreDestroy(final LifeCycleCallback preDestroy) {
99         preDestroyList.add(preDestroy);
100     }
101
102     /**
103      * @return the list of all pre-destroy elements
104      */

105     public List JavaDoc<LifeCycleCallback> getPreDestroyList() {
106         return preDestroyList;
107     }
108
109 }
110
Popular Tags