KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > Containers > HomeServantImpl


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2001-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): Sylvain Leblanc, Romain Rouvoy________.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.Containers;
28
29 import org.objectweb.openccm.Containers.MetaInformation.HomeInstance;
30
31 /**
32  * Implementation class of the HomeServant native interface.
33  *
34  * @author <a HREF="mailto:Mathieu.Vadet@lifl.fr">Mathieu Vadet</a>
35  *
36  * @version 0.3
37  */

38
39 public class HomeServantImpl
40        extends org.omg.CORBA.LocalObject JavaDoc
41        implements HomeServant
42 {
43     // ==================================================================
44
//
45
// Internal state.
46
//
47
// ==================================================================
48

49     /**
50      **
51      **/

52     protected org.objectweb.openccm.Containers.SystemConfiguration the_home_configuration_;
53
54     /**
55      **
56      **/

57     protected org.objectweb.openccm.Containers.SystemConfiguration the_component_configuration_;
58
59     /**
60      **
61      **/

62     protected org.objectweb.openccm.Containers.SystemHomeFinder the_home_finder_;
63
64     /**
65      **
66      **/

67     
68     protected HomeInstance the_home_instance_;
69     
70     /**
71      **
72      **/

73         
74     protected org.objectweb.openccm.Containers.PCA the_PCA_;
75
76     /**
77      **
78      **/

79     protected HomeExecutorBase the_home_executor_;
80
81     /**
82      **
83      **/

84     protected org.omg.Components.CCMHome the_home_ref_;
85
86     /**
87      **
88      **/

89     protected org.omg.Components.Cookie the_cookie_;
90
91     /**
92      **
93      **/

94     protected org.objectweb.openccm.Deployment.ContainerBase the_container_base_;
95
96     // ==================================================================
97
//
98
// Constructor.
99
//
100
// ==================================================================
101

102     /**
103      ** The constructor.
104      **
105      **/

106     public
107     HomeServantImpl()
108     {
109         the_home_configuration_ = null;
110         the_component_configuration_ = null;
111         the_home_finder_ = null;
112         the_PCA_ = null;
113         the_home_executor_ = null;
114         the_home_ref_ = null;
115         the_cookie_ = null;
116         the_container_base_ = null;
117         the_home_instance_ = null;
118     }
119
120     // ==================================================================
121
//
122
// Internal methods.
123
//
124
// ==================================================================
125

126    // ==================================================================
127
//
128
// Public methods for the HomeServant interface.
129
//
130
// ==================================================================
131

132
133   //
134
// IDL:goal.lifl.fr/OpenCCM/Containers/HomeServant/the_home_instance:1.0
135
//
136

137   public HomeInstance
138   the_home_instance()
139   {
140      return the_home_instance_;
141   }
142
143   //
144
// IDL:goal.lifl.fr/OpenCCM/Containers/HomeServant/the_home_instance:1.0
145
//
146

147   public void
148   the_home_instance(HomeInstance value)
149   {
150     the_home_instance_= value;
151   }
152     //
153
// IDL:goal.lifl.fr/OpenCCM/Containers/HomeServant/the_home_configuration:1.0
154
//
155
/**
156      **
157      **/

158     public org.objectweb.openccm.Containers.SystemConfiguration
159     the_home_configuration()
160     {
161         return the_home_configuration_;
162     }
163
164     //
165
// IDL:goal.lifl.fr/OpenCCM/Containers/HomeServant/the_home_configuration:1.0
166
//
167
/**
168      **
169      **/

170     public org.objectweb.openccm.Containers.SystemConfiguration
171     the_component_configuration()
172     {
173         return the_component_configuration_;
174     }
175
176     //
177
// IDL:goal.lifl.fr/OpenCCM/Containers/HomeServant/the_home_finder:1.0
178
//
179
/**
180      **
181      **/

182     public org.objectweb.openccm.Containers.SystemHomeFinder
183     the_home_finder()
184     {
185         return the_home_finder_;
186     }
187
188     //
189
// IDL:goal.lifl.fr/OpenCCM/Containers/HomeServant/the_PCA:1.0
190
//
191
/**
192      **
193      **/

194     public org.objectweb.openccm.Containers.PCA
195     the_PCA()
196     {
197         return the_PCA_;
198     }
199
200     //
201
// IDL:goal.lifl.fr/OpenCCM/Containers/HomeServant/the_home_executor:1.0
202
//
203
/**
204      **
205      **/

206     public HomeExecutorBase
207     the_home_executor()
208     {
209         return the_home_executor_;
210     }
211
212     //
213
// IDL:goal.lifl.fr/OpenCCM/Containers/HomeServant/the_home_ref:1.0
214
//
215
/**
216      **
217      **/

218     public org.omg.Components.CCMHome
219     the_home_ref()
220     {
221         return the_home_ref_;
222     }
223
224     //
225
// IDL:goal.lifl.fr/OpenCCM/Containers/HomeServant/the_registration_info:1.0
226
//
227
/**
228      **
229      **/

230     public org.omg.Components.Cookie
231     the_registration_info()
232     {
233         return the_cookie_;
234     }
235
236     /**
237      **
238      **/

239     public void
240     the_container_base(org.objectweb.openccm.Deployment.ContainerBase container)
241     {
242         the_container_base_ = container;
243     }
244
245     /**
246      **
247      **/

248     public org.objectweb.openccm.Deployment.ContainerBase
249     the_container_base()
250     {
251         return the_container_base_;
252     }
253
254      // ==================================================================
255
//
256
// Public methods.
257
//
258
// ==================================================================
259

260     /**
261      **
262      **/

263     public void
264     the_home_configuration(org.objectweb.openccm.Containers.SystemConfiguration config)
265     {
266         the_home_configuration_ = config;
267     }
268
269     /**
270      **
271      **/

272     public void
273     the_component_configuration(org.objectweb.openccm.Containers.SystemConfiguration config)
274     {
275         the_component_configuration_ = config;
276     }
277
278     /**
279      **
280      **/

281     public void
282     the_home_finder(org.objectweb.openccm.Containers.SystemHomeFinder finder)
283     {
284         the_home_finder_ = finder;
285     }
286
287     /**
288      **
289      **/

290     public void
291     the_PCA(PCA pca)
292     {
293         the_PCA_ = pca;
294     }
295
296     /**
297      **
298      **/

299     public void
300     the_home_executor(HomeExecutorBase home)
301     {
302         the_home_executor_ = home;
303     }
304
305     /**
306      **
307      **/

308     public void
309     the_home_ref(org.omg.Components.CCMHome ref)
310     {
311         the_home_ref_ = ref;
312     }
313
314     /**
315      **
316      **/

317     public void
318     the_registration_info(org.omg.Components.Cookie cookie)
319     {
320         the_cookie_ = cookie;
321     }
322
323     /**
324      ** Remove the CCMHome
325      **/

326     public void
327     remove()
328         throws org.omg.Components.RemoveFailure
329     {
330         the_container_base().get_rootPCA().deactivate_home(this);
331 /* Bug #306
332    OLD CODE
333
334         the_container_base().remove_home(the_home_ref());
335
336    NEW CODE
337 */

338
339         // Unregisters the home from its container.
340
the_container_base().unregister_home(the_home_ref());
341
342     }
343 }
344
Popular Tags