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: JContainerConfig.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.container;
025:
026: import java.util.ArrayList;
027: import java.util.List;
028:
029: import org.ow2.easybeans.api.EZBContainerConfig;
030: import org.ow2.easybeans.api.EZBContainerLifeCycleCallback;
031: import org.ow2.easybeans.api.EZBServer;
032: import org.ow2.easybeans.api.injection.ResourceInjector;
033: import org.ow2.util.ee.deploy.api.archive.IArchive;
034:
035: /**
036: * Store Configuration for a {@link JContainer3} instance.
037: * @author Guillaume Sauthier
038: */
039: public class JContainerConfig implements EZBContainerConfig {
040:
041: /**
042: * EjbJar archive.
043: */
044: private IArchive archive;
045:
046: /**
047: * Embedded server.
048: */
049: private EZBServer embedded;
050:
051: /**
052: * Callback List.
053: */
054: private List<EZBContainerLifeCycleCallback> callbacks;
055:
056: /**
057: * Resource Injectors List.
058: */
059: private List<ResourceInjector> injectors;
060:
061: /**
062: * Constructor.
063: * @param archive the archive to process.
064: */
065: public JContainerConfig(final IArchive archive) {
066: super ();
067: this .archive = archive;
068: this .callbacks = new ArrayList<EZBContainerLifeCycleCallback>();
069: this .injectors = new ArrayList<ResourceInjector>();
070: }
071:
072: /**
073: * @return the callbacks
074: */
075: public List<EZBContainerLifeCycleCallback> getCallbacks() {
076: return callbacks;
077: }
078:
079: /**
080: * @param callback the callbacks to add.
081: */
082: public void addCallback(final EZBContainerLifeCycleCallback callback) {
083: this .callbacks.add(callback);
084: }
085:
086: /**
087: * @return the archive
088: */
089: public IArchive getArchive() {
090: return archive;
091: }
092:
093: /**
094: * @return the injectors
095: */
096: public List<ResourceInjector> getInjectors() {
097: return injectors;
098: }
099:
100: /**
101: * @param injector the injectors to set
102: */
103: public void addInjectors(final ResourceInjector injector) {
104: this .injectors.add(injector);
105: }
106:
107: /**
108: * @return the embedded server
109: */
110: public EZBServer getEZBServer() {
111: return embedded;
112: }
113:
114: /**
115: * Sets the embedded server.
116: * @param embedded the embedded server of this config
117: */
118: public void setEZBServer(final EZBServer embedded) {
119: this.embedded = embedded;
120: }
121: }
|