KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > Deployment > ContainerImpl


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2002 USTL - LIFL - GOAL
5 Contact: openccm-team@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Mathieu Vadet.
23 Contributor(s): Romain Rouvoy, Briclet Fr?d?ric_____________________.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.Deployment;
28
29 /**
30  * This class implements the OMG IDL
31  * OpenCCM::ComponentServer::Container interface.
32  *
33  * @author <a HREF="mailto:Mathieu.Vadet@lifl.fr">Mathieu Vadet</a>
34  * @author <a HREF="mailto:Romain.Rouvoy@lifl.fr">Romain Rouvoy</a>
35  * @author <a HREF="mailto:Frederic.Briclet@lifl.fr">Briclet Fr?d?ric</a>
36  * @version 0.3
37  */

38
39 public class ContainerImpl
40 extends org.omg.Components.Deployment.ContainerPOA
41 {
42     // ==================================================================
43
//
44
// Internal state.
45
//
46
// ==================================================================
47

48     protected ContainerBase the_container_;
49     
50     // ==================================================================
51
//
52
// Constructor.
53
//
54
// ==================================================================
55

56     /**
57      ** The constructor.
58      **
59      ** @param classLoader The class loader used to load home classes.
60      ** @param script The base configuration of the container.
61      **
62      ** @throws BadConfiguration If the base configuration script is not valid.
63      **/

64     public
65     ContainerImpl(org.omg.Components.ConfigValue[] config,
66                     /* ----> Fred modificatuib ComponentServerBase to
67                      * componentServerImpl*/

68                   ComponentServerImpl component_server)
69         throws org.omg.Components.CreateFailure,
70                    org.omg.Components.Deployment.InvalidConfiguration
71     {
72         the_container_ = new ContainerBase (config, component_server,
73                                             TheComponentInstallation.getComponentInstallation()) ;
74     }
75
76
77     /**
78      ** The constructor.
79      **
80      ** @param config the config to use
81      ** @param component_server the parent component server
82      ** @param c_i the component installation to use for retrieving archive
83      **
84      ** @throws BadConfiguration If the base configuration script is not valid.
85      **/

86     public
87     ContainerImpl(org.omg.Components.ConfigValue[] config,
88                     /* ----> Fred modificatuib ComponentServerBase to
89                      * componentServerImpl*/

90                   ComponentServerImpl component_server,
91                   org.omg.Components.Deployment.ComponentInstallation c_i)
92         throws org.omg.Components.CreateFailure,
93                    org.omg.Components.Deployment.InvalidConfiguration
94     {
95         the_container_ = new ContainerBase (config, component_server,c_i) ;
96     }
97
98
99     // ==================================================================
100
//
101
// Internal methods.
102
//
103
// ==================================================================
104

105     // ==================================================================
106
//
107
// Public methods.
108
//
109
// ==================================================================
110

111     public org.objectweb.openccm.Deployment.ContainerBase
112         _delegate()
113     {
114                 return the_container_;
115     }
116
117
118     public void
119     add_listener (org.objectweb.openccm.Deployment.listener.ContainerListener listener)
120     {
121         the_container_.add_listener (listener);
122     }
123
124     /**
125      **
126      **/

127     public org.objectweb.openccm.Containers.SystemHome
128     create_system_home(java.lang.String JavaDoc implUUID,
129                        java.lang.String JavaDoc alias,
130                        java.lang.String JavaDoc entrypt)
131         throws org.objectweb.openccm.Containers.CreationFailed
132     {
133         return the_container_.create_system_home(implUUID, alias, entrypt);
134     }
135
136     /**
137      **
138      **/

139     public org.objectweb.openccm.Containers.SystemHome
140     find_system_home(java.lang.String JavaDoc alias)
141         throws org.objectweb.openccm.Containers.HomeNotFound
142     {
143         return the_container_.find_system_home(alias);
144     }
145
146     /**
147      **
148      **/

149     public void
150     set_container_configuration(org.objectweb.openccm.Containers.SystemConfiguration config)
151     {
152         the_container_.set_container_configuration (config);
153     }
154
155     /**
156      **
157      **/

158     public org.objectweb.openccm.Containers.SystemConfiguration
159     get_container_configuration()
160     {
161         return the_container_.get_container_configuration () ;
162     }
163
164     /**
165      **
166      **/

167     public void
168     set_home_configuration(org.objectweb.openccm.Containers.SystemConfiguration config)
169     {
170         the_container_.set_home_configuration (config);
171     }
172
173     /**
174      **
175      **/

176     public org.objectweb.openccm.Containers.SystemConfiguration
177     get_home_configuration()
178     {
179         return the_container_.get_home_configuration () ;
180     }
181
182     /**
183      **
184      **/

185     public void
186     set_component_configuration(org.objectweb.openccm.Containers.SystemConfiguration config)
187     {
188         the_container_.set_component_configuration (config);
189     }
190
191     /**
192      **
193      **/

194     public org.objectweb.openccm.Containers.SystemConfiguration
195     get_component_configuration()
196     {
197         return the_container_.get_component_configuration () ;
198     }
199
200      // ==================================================================
201
//
202
// Methods for the Components::Deployment::Container interface.
203
//
204
// ==================================================================
205

206     //
207
// IDL:omg.org/Components/Deployment/ComponentServer/configuration:1.0
208
//
209
/**
210      ** To obtain the container configuration.
211      **
212      **/

213     public org.omg.Components.ConfigValue[]
214     configuration()
215     {
216         return the_container_.configuration () ;
217     }
218
219     //
220
// IDL:omg.org/Components/Deployment/Container/get_component_server:1.0
221
//
222
/**
223      ** To obtain a reference on the component server that has created this container.
224      **/

225     public org.omg.Components.Deployment.ComponentServer
226     get_component_server()
227     {
228         return the_container_.get_component_server();
229     }
230
231     //
232
// IDL:omg.org/Components/Deployment/Container/install_home:1.0
233
//
234
/**
235      ** Create and install a home in the container.
236      ** This can be done more than once.
237      **
238      ** @param entry_pt The entry point in the archive.
239      ** @param name The name of the created home.
240      ** @param script The configuration script specific to the home.
241      **
242      ** @return The created home.
243      **
244      ** @exception CreationFailed If the home can not be created.
245      ** @exception BadConfiguration If the configuration script is not valid.
246      **
247      **/

248     public org.omg.Components.CCMHome
249     install_home(java.lang.String JavaDoc uuid,
250                  java.lang.String JavaDoc entrypt,
251                  org.omg.Components.ConfigValue[] config)
252         throws org.omg.Components.Deployment.UnknownImplId,
253                    org.omg.Components.Deployment.ImplEntryPointNotFound,
254            org.omg.Components.Deployment.InstallationFailure,
255            org.omg.Components.Deployment.InvalidConfiguration
256     {
257         return the_container_.install_home (uuid, entrypt, config);
258     }
259
260     //
261
// IDL:omg.org/Components/Deployment/Container/remove_home:1.0
262
//
263
/**
264      **
265      **/

266     public void
267     remove_home(org.omg.Components.CCMHome ref)
268         throws org.omg.Components.RemoveFailure
269     {
270         the_container_.remove_home (ref);
271     }
272
273     //
274
// IDL:omg.org/Components/Deployment/Container/get_homes:1.0
275
//
276
/**
277      **
278      **/

279     public org.omg.Components.CCMHome[]
280     get_homes()
281     {
282         return the_container_.get_homes ();
283     }
284
285     /**
286      * Set the corba reference for the relative container
287      */

288     public void
289       the_container_ref(org.omg.Components.Deployment.Container container)
290     {
291                 the_container_.the_container_ref(container);
292     }
293
294
295     //
296
// IDL:omg.org/Components/Deployment/Container/remove:1.0
297
//
298
/**
299      **
300      **/

301     public void
302     remove()
303         throws org.omg.Components.RemoveFailure
304     {
305         the_container_.remove ();
306     }
307 }
308
Popular Tags