001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.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 1any 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: * Initial developer: Florent BENOIT
022: * --------------------------------------------------------------------------
023: * $Id: AbsJonasEnvironmentElement.java 4780 2004-05-19 21:10:21Z ehardesty $
024: * --------------------------------------------------------------------------
025: */package org.objectweb.jonas_lib.deployment.xml;
026:
027: /**
028: * This class defines an abstract implementation for all jonas environment element
029: * (jonas-entity, jonas-session, jonas-web-app, jonas-client, etc.).
030: *
031: * @author Florent Benoit
032: */
033: public abstract class AbsJonasEnvironmentElement extends AbsElement
034: implements JonasJndiEnvRefsGroupXml {
035:
036: /**
037: * List of jonas-ejb-ref
038: */
039: private JLinkedList jonasEjbRefList = null;
040:
041: /**
042: * List of jonas-resource-env
043: */
044: private JLinkedList jonasResourceEnvRefList = null;
045:
046: /**
047: * List of jonas-resource
048: */
049: private JLinkedList jonasResourceRefList = null;
050:
051: /**
052: * List of jonas-service-ref
053: */
054: private JLinkedList jonasServiceRefList = null;
055:
056: /**
057: * List of jonas-message-destination-ref
058: */
059: private JLinkedList jonasMessageDestinationRefList = null;
060:
061: /**
062: * Constructor : build a new object which is common to environment elements
063: */
064: public AbsJonasEnvironmentElement() {
065: super ();
066: jonasEjbRefList = new JLinkedList("jonas-ejb-ref");
067: jonasResourceEnvRefList = new JLinkedList("jonas-resource-env");
068: jonasResourceRefList = new JLinkedList("jonas-resource");
069: jonasServiceRefList = new JLinkedList("jonas-service-ref");
070: jonasMessageDestinationRefList = new JLinkedList(
071: "jonas-message-destination-ref");
072: }
073:
074: // Setters
075:
076: /**
077: * Add a new jonas-ejb-ref element to this object
078: * @param jonasEjbRef the jonas-ejb-ref object
079: */
080: public void addJonasEjbRef(JonasEjbRef jonasEjbRef) {
081: jonasEjbRefList.add(jonasEjbRef);
082: }
083:
084: /**
085: * Add a new jonas-resource-env element to this object
086: * @param jonasResourceEnv the jonas-resource-env object
087: */
088: public void addJonasResourceEnv(JonasResourceEnv jonasResourceEnv) {
089: jonasResourceEnvRefList.add(jonasResourceEnv);
090: }
091:
092: /**
093: * Add a new jonas-resource element to this object
094: * @param jonasResource the jonas-resource object
095: */
096: public void addJonasResource(JonasResource jonasResource) {
097: jonasResourceRefList.add(jonasResource);
098: }
099:
100: /**
101: * Add a new jonas-service-ref element to this object
102: * @param jonasServiceRef the jonas-service-ref object
103: */
104: public void addJonasServiceRef(JonasServiceRef jonasServiceRef) {
105: jonasServiceRefList.add(jonasServiceRef);
106: }
107:
108: /**
109: * Add a new jonas-message-destination-ref element to this object
110: * @param jonasMessageDestinationRef the jonas-message-destination-ref object
111: */
112: public void addJonasMessageDestinationRef(
113: JonasMessageDestinationRef jonasMessageDestinationRef) {
114: jonasMessageDestinationRefList.add(jonasMessageDestinationRef);
115: }
116:
117: // Getters
118:
119: /**
120: * @return the list of all jonas-ejb-ref elements
121: */
122: public JLinkedList getJonasEjbRefList() {
123: return jonasEjbRefList;
124: }
125:
126: /**
127: * @return the list of all jonas-resource-env elements
128: */
129: public JLinkedList getJonasResourceEnvList() {
130: return jonasResourceEnvRefList;
131: }
132:
133: /**
134: * @return the list of all jonas-resource elements
135: */
136: public JLinkedList getJonasResourceList() {
137: return jonasResourceRefList;
138: }
139:
140: /**
141: * @return the list of all jonas-service-ref elements
142: */
143: public JLinkedList getJonasServiceRefList() {
144: return jonasServiceRefList;
145: }
146:
147: /**
148: * @return the list of all jonas-message-destination-ref elements
149: */
150: public JLinkedList getJonasMessageDestinationRefList() {
151: return jonasMessageDestinationRefList;
152: }
153:
154: }
|