KickJava   Java API By Example, From Geeks To Geeks.

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


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: AbsJonasEnvironmentElement.java,v 1.4 2004/05/19 21:07:28 ehardesty Exp $
24  * --------------------------------------------------------------------------
25  */

26
27 package org.objectweb.jonas_lib.deployment.xml;
28
29 /**
30  * This class defines an abstract implementation for all jonas environment element
31  * (jonas-entity, jonas-session, jonas-web-app, jonas-client, etc.).
32  *
33  * @author Florent Benoit
34  */

35 public abstract class AbsJonasEnvironmentElement extends AbsElement implements JonasJndiEnvRefsGroupXml {
36
37     /**
38      * List of jonas-ejb-ref
39      */

40     private JLinkedList jonasEjbRefList = null;
41
42     /**
43      * List of jonas-resource-env
44      */

45     private JLinkedList jonasResourceEnvRefList = null;
46
47     /**
48      * List of jonas-resource
49      */

50     private JLinkedList jonasResourceRefList = null;
51
52
53     /**
54      * List of jonas-service-ref
55      */

56     private JLinkedList jonasServiceRefList = null;
57
58     /**
59      * List of jonas-message-destination-ref
60      */

61     private JLinkedList jonasMessageDestinationRefList = null;
62
63     /**
64      * Constructor : build a new object which is common to environment elements
65      */

66     public AbsJonasEnvironmentElement() {
67         super();
68         jonasEjbRefList = new JLinkedList("jonas-ejb-ref");
69         jonasResourceEnvRefList = new JLinkedList("jonas-resource-env");
70         jonasResourceRefList = new JLinkedList("jonas-resource");
71         jonasServiceRefList = new JLinkedList("jonas-service-ref");
72         jonasMessageDestinationRefList = new JLinkedList("jonas-message-destination-ref");
73     }
74
75
76
77     // Setters
78

79     /**
80      * Add a new jonas-ejb-ref element to this object
81      * @param jonasEjbRef the jonas-ejb-ref object
82      */

83     public void addJonasEjbRef(JonasEjbRef jonasEjbRef) {
84         jonasEjbRefList.add(jonasEjbRef);
85     }
86
87
88     /**
89      * Add a new jonas-resource-env element to this object
90      * @param jonasResourceEnv the jonas-resource-env object
91      */

92     public void addJonasResourceEnv(JonasResourceEnv jonasResourceEnv) {
93         jonasResourceEnvRefList.add(jonasResourceEnv);
94     }
95
96     /**
97      * Add a new jonas-resource element to this object
98      * @param jonasResource the jonas-resource object
99      */

100     public void addJonasResource(JonasResource jonasResource) {
101         jonasResourceRefList.add(jonasResource);
102     }
103
104     /**
105      * Add a new jonas-service-ref element to this object
106      * @param jonasServiceRef the jonas-service-ref object
107      */

108     public void addJonasServiceRef(JonasServiceRef jonasServiceRef) {
109         jonasServiceRefList.add(jonasServiceRef);
110     }
111
112
113     /**
114      * Add a new jonas-message-destination-ref element to this object
115      * @param jonasMessageDestinationRef the jonas-message-destination-ref object
116      */

117     public void addJonasMessageDestinationRef(JonasMessageDestinationRef jonasMessageDestinationRef) {
118         jonasMessageDestinationRefList.add(jonasMessageDestinationRef);
119     }
120
121     // Getters
122

123     /**
124      * @return the list of all jonas-ejb-ref elements
125      */

126     public JLinkedList getJonasEjbRefList() {
127         return jonasEjbRefList;
128     }
129
130     /**
131      * @return the list of all jonas-resource-env elements
132      */

133     public JLinkedList getJonasResourceEnvList() {
134         return jonasResourceEnvRefList;
135     }
136
137     /**
138      * @return the list of all jonas-resource elements
139      */

140     public JLinkedList getJonasResourceList() {
141         return jonasResourceRefList;
142     }
143
144
145     /**
146      * @return the list of all jonas-service-ref elements
147      */

148     public JLinkedList getJonasServiceRefList() {
149         return jonasServiceRefList;
150     }
151
152     /**
153      * @return the list of all jonas-message-destination-ref elements
154      */

155     public JLinkedList getJonasMessageDestinationRefList() {
156         return jonasMessageDestinationRefList;
157     }
158
159 }
160
Popular Tags