001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */package org.apache.openejb.config.sys;
017:
018: import javax.xml.bind.annotation.XmlAccessType;
019: import javax.xml.bind.annotation.XmlAccessorType;
020: import javax.xml.bind.annotation.XmlElement;
021: import javax.xml.bind.annotation.XmlRootElement;
022: import javax.xml.bind.annotation.XmlType;
023: import java.util.ArrayList;
024: import java.util.List;
025:
026: /**
027: * <p>Java class for anonymous complex type.
028: * <p/>
029: * <p>The following schema fragment specifies the expected content contained within this class.
030: * <p/>
031: * <pre>
032: * <complexType>
033: * <complexContent>
034: * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
035: * <sequence>
036: * <element ref="{http://www.openejb.org/System/Configuration}Container" maxOccurs="unbounded"/>
037: * <element ref="{http://www.openejb.org/System/Configuration}JndiProvider" maxOccurs="unbounded" minOccurs="0"/>
038: * <element ref="{http://www.openejb.org/System/Configuration}SecurityService" minOccurs="0"/>
039: * <element ref="{http://www.openejb.org/System/Configuration}TransactionManager" minOccurs="0"/>
040: * <element ref="{http://www.openejb.org/System/Configuration}ConnectionManager" minOccurs="0"/>
041: * <element ref="{http://www.openejb.org/System/Configuration}ProxyFactory" minOccurs="0"/>
042: * <element ref="{http://www.openejb.org/System/Configuration}Connector" maxOccurs="unbounded" minOccurs="0"/>
043: * <element ref="{http://www.openejb.org/System/Configuration}Resource" maxOccurs="unbounded" minOccurs="0"/>
044: * <element ref="{http://www.openejb.org/System/Configuration}Deployments" maxOccurs="unbounded" minOccurs="0"/>
045: * </sequence>
046: * </restriction>
047: * </complexContent>
048: * </complexType>
049: * </pre>
050: */
051: @XmlAccessorType(XmlAccessType.FIELD)
052: @XmlType(name="",propOrder={"container","jndiProvider","securityService","transactionManager","connectionManager","proxyFactory","connector","resource","deployments"})
053: @XmlRootElement(name="openejb")
054: public class Openejb {
055:
056: @XmlElement(name="Container",required=true)
057: protected List<Container> container;
058: @XmlElement(name="JndiProvider")
059: protected List<JndiProvider> jndiProvider;
060: @XmlElement(name="SecurityService")
061: protected SecurityService securityService;
062: @XmlElement(name="TransactionManager")
063: protected TransactionManager transactionManager;
064: @XmlElement(name="ConnectionManager")
065: protected ConnectionManager connectionManager;
066: @XmlElement(name="ProxyFactory")
067: protected ProxyFactory proxyFactory;
068: @XmlElement(name="Connector")
069: protected List<Connector> connector;
070: @XmlElement(name="Resource")
071: protected List<Resource> resource;
072: @XmlElement(name="Deployments")
073: protected List<Deployments> deployments;
074:
075: /**
076: * Gets the value of the container property.
077: * <p/>
078: * <p/>
079: * This accessor method returns a reference to the live list,
080: * not a snapshot. Therefore any modification you make to the
081: * returned list will be present inside the JAXB object.
082: * This is why there is not a <CODE>set</CODE> method for the container property.
083: * <p/>
084: * <p/>
085: * For example, to add a new item, do as follows:
086: * <pre>
087: * getContainer().add(newItem);
088: * </pre>
089: * <p/>
090: * <p/>
091: * <p/>
092: * Objects of the following type(s) are allowed in the list
093: * {@link Container }
094: */
095: public List<Container> getContainer() {
096: if (container == null) {
097: container = new ArrayList<Container>();
098: }
099: return this .container;
100: }
101:
102: /**
103: * Gets the value of the jndiProvider property.
104: * <p/>
105: * <p/>
106: * This accessor method returns a reference to the live list,
107: * not a snapshot. Therefore any modification you make to the
108: * returned list will be present inside the JAXB object.
109: * This is why there is not a <CODE>set</CODE> method for the jndiProvider property.
110: * <p/>
111: * <p/>
112: * For example, to add a new item, do as follows:
113: * <pre>
114: * getJndiProvider().add(newItem);
115: * </pre>
116: * <p/>
117: * <p/>
118: * <p/>
119: * Objects of the following type(s) are allowed in the list
120: * {@link JndiProvider }
121: */
122: public List<JndiProvider> getJndiProvider() {
123: if (jndiProvider == null) {
124: jndiProvider = new ArrayList<JndiProvider>();
125: }
126: return this .jndiProvider;
127: }
128:
129: /**
130: * Gets the value of the securityService property.
131: *
132: * @return possible object is
133: * {@link SecurityService }
134: */
135: public SecurityService getSecurityService() {
136: return securityService;
137: }
138:
139: /**
140: * Sets the value of the securityService property.
141: *
142: * @param value allowed object is
143: * {@link SecurityService }
144: */
145: public void setSecurityService(SecurityService value) {
146: this .securityService = value;
147: }
148:
149: /**
150: * Gets the value of the transactionManager property.
151: *
152: * @return possible object is
153: * {@link TransactionManager }
154: */
155: public TransactionManager getTransactionManager() {
156: return transactionManager;
157: }
158:
159: /**
160: * Sets the value of the transactionManager property.
161: *
162: * @param value allowed object is
163: * {@link TransactionManager }
164: */
165: public void setTransactionManager(TransactionManager value) {
166: this .transactionManager = value;
167: }
168:
169: /**
170: * Gets the value of the connectionManager property.
171: *
172: * @return possible object is
173: * {@link ConnectionManager }
174: */
175: public ConnectionManager getConnectionManager() {
176: return connectionManager;
177: }
178:
179: /**
180: * Sets the value of the connectionManager property.
181: *
182: * @param value allowed object is
183: * {@link ConnectionManager }
184: */
185: public void setConnectionManager(ConnectionManager value) {
186: this .connectionManager = value;
187: }
188:
189: /**
190: * Gets the value of the proxyFactory property.
191: *
192: * @return possible object is
193: * {@link ProxyFactory }
194: */
195: public ProxyFactory getProxyFactory() {
196: return proxyFactory;
197: }
198:
199: /**
200: * Sets the value of the proxyFactory property.
201: *
202: * @param value allowed object is
203: * {@link ProxyFactory }
204: */
205: public void setProxyFactory(ProxyFactory value) {
206: this .proxyFactory = value;
207: }
208:
209: /**
210: * Gets the value of the connector property.
211: * <p/>
212: * <p/>
213: * This accessor method returns a reference to the live list,
214: * not a snapshot. Therefore any modification you make to the
215: * returned list will be present inside the JAXB object.
216: * This is why there is not a <CODE>set</CODE> method for the connector property.
217: * <p/>
218: * <p/>
219: * For example, to add a new item, do as follows:
220: * <pre>
221: * getConnector().add(newItem);
222: * </pre>
223: * <p/>
224: * <p/>
225: * <p/>
226: * Objects of the following type(s) are allowed in the list
227: * {@link Connector }
228: */
229: private List<Connector> getConnector() {
230: if (connector == null) {
231: connector = new ArrayList<Connector>();
232: }
233: return this .connector;
234: }
235:
236: /**
237: * Gets the value of the resource property.
238: * <p/>
239: * <p/>
240: * This accessor method returns a reference to the live list,
241: * not a snapshot. Therefore any modification you make to the
242: * returned list will be present inside the JAXB object.
243: * This is why there is not a <CODE>set</CODE> method for the resource property.
244: * <p/>
245: * <p/>
246: * For example, to add a new item, do as follows:
247: * <pre>
248: * getResource().add(newItem);
249: * </pre>
250: * <p/>
251: * <p/>
252: * <p/>
253: * Objects of the following type(s) are allowed in the list
254: * {@link Resource }
255: */
256: public List<Resource> getResource() {
257: if (resource == null) {
258: resource = new ArrayList<Resource>();
259: }
260:
261: List<Connector> connectors = getConnector();
262: if (connectors.size() > 0) {
263: for (Connector connector : connectors) {
264: Resource resource = new Resource();
265: resource.setJar(connector.getJar());
266: resource.setId(connector.getId());
267: resource.setType(connector.getType());
268: resource.setProvider(connector.getProvider());
269: resource.getProperties().putAll(
270: connector.getProperties());
271: this .resource.add(resource);
272: }
273: connectors.clear();
274: }
275: return this .resource;
276: }
277:
278: /**
279: * Gets the value of the deployments property.
280: * <p/>
281: * <p/>
282: * This accessor method returns a reference to the live list,
283: * not a snapshot. Therefore any modification you make to the
284: * returned list will be present inside the JAXB object.
285: * This is why there is not a <CODE>set</CODE> method for the deployments property.
286: * <p/>
287: * <p/>
288: * For example, to add a new item, do as follows:
289: * <pre>
290: * getDeployments().add(newItem);
291: * </pre>
292: * <p/>
293: * <p/>
294: * <p/>
295: * Objects of the following type(s) are allowed in the list
296: * {@link Deployments }
297: */
298: public List<Deployments> getDeployments() {
299: if (deployments == null) {
300: deployments = new ArrayList<Deployments>();
301: }
302: return this .deployments;
303: }
304:
305: public void add(Object service) {
306: if (service instanceof Container) {
307: getContainer().add((Container) service);
308: } else if (service instanceof Connector) {
309: getConnector().add((Connector) service);
310: } else if (service instanceof Resource) {
311: getResource().add((Resource) service);
312: } else if (service instanceof JndiProvider) {
313: getJndiProvider().add((JndiProvider) service);
314: } else if (service instanceof ConnectionManager) {
315: setConnectionManager((ConnectionManager) service);
316: } else if (service instanceof ProxyFactory) {
317: setProxyFactory((ProxyFactory) service);
318: } else if (service instanceof TransactionManager) {
319: setTransactionManager((TransactionManager) service);
320: } else if (service instanceof SecurityService) {
321: setSecurityService((SecurityService) service);
322: } else if (service instanceof Deployments) {
323: getDeployments().add((Deployments) service);
324: }
325: }
326: }
|