KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > container > JContainerConfig


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: JContainerConfig.java 925 2006-07-25 12:37:03Z benoitf $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.container;
26
27 import java.util.ArrayList JavaDoc;
28 import java.util.List JavaDoc;
29
30 import org.objectweb.easybeans.api.EZBArchive;
31 import org.objectweb.easybeans.api.EZBContainerConfig;
32 import org.objectweb.easybeans.api.EZBContainerLifeCycleCallback;
33 import org.objectweb.easybeans.api.EZBServer;
34 import org.objectweb.easybeans.api.injection.ResourceInjector;
35
36 /**
37  * Store Configuration for a {@link JContainer3} instance.
38  * @author Guillaume Sauthier
39  */

40 public class JContainerConfig implements EZBContainerConfig {
41
42     /**
43      * EjbJar archive.
44      */

45     private EZBArchive archive;
46
47     /**
48      * Embedded server.
49      */

50     private EZBServer embedded;
51
52     /**
53      * Callback List.
54      */

55     private List JavaDoc<EZBContainerLifeCycleCallback> callbacks;
56
57     /**
58      * Resource Injectors List.
59      */

60     private List JavaDoc<ResourceInjector> injectors;
61
62     /**
63      * Constructor.
64      * @param archive the archive to process.
65      */

66     public JContainerConfig(final EZBArchive archive) {
67         super();
68         this.archive = archive;
69         this.callbacks = new ArrayList JavaDoc<EZBContainerLifeCycleCallback>();
70         this.injectors = new ArrayList JavaDoc<ResourceInjector>();
71     }
72
73     /**
74      * @return the callbacks
75      */

76     public List JavaDoc<EZBContainerLifeCycleCallback> getCallbacks() {
77         return callbacks;
78     }
79
80     /**
81      * @param callback the callbacks to add.
82      */

83     public void addCallback(final EZBContainerLifeCycleCallback callback) {
84         this.callbacks.add(callback);
85     }
86
87     /**
88      * @return the archive
89      */

90     public EZBArchive getArchive() {
91         return archive;
92     }
93
94     /**
95      * @return the injectors
96      */

97     public List JavaDoc<ResourceInjector> getInjectors() {
98         return injectors;
99     }
100
101     /**
102      * @param injector the injectors to set
103      */

104     public void addInjectors(final ResourceInjector injector) {
105         this.injectors.add(injector);
106     }
107
108     /**
109      * @return the embedded server
110      */

111     public EZBServer getEZBServer() {
112         return embedded;
113     }
114
115     /**
116      * Sets the embedded server.
117      * @param embedded the embedded server of this config
118      */

119     public void setEZBServer(final EZBServer embedded) {
120         this.embedded = embedded;
121     }
122 }
123
Popular Tags