KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > OpenCCM_DCI > cif > AssemblyManagerRegistrationImpl


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): Briclet Frederic
23 Contributor(s): ---------------------------------------------
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.OpenCCM_DCI.cif;
28
29 import org.objectweb.openccm.OpenCCM_DCI.*;
30 /**
31  * This is the implementation of the OpenCCM_DCI::AssemblyManagerRegistration
32  * component type.
33  * In that implementation all the registration event are manage with connection
34  * on the main component interface.
35  * This class inherits from the skeleton
36  * generated by the OpenCCM's CIF to Java mapping generator.
37  *
38  * @author <a HREF="mailto:Frederic.Briclet@lifl.fr">Briclet Frederic</A>
39  */

40
41 public class AssemblyManagerRegistrationImpl
42     extends org.objectweb.openccm.OpenCCM_DCI
43             .AssemblyFactoryManagerSessionComposition
44             .AssemblyManagerRegistrationSeg
45 {
46     // ==================================================================
47
//
48
// Internal state.
49
//
50
// ==================================================================
51
// ==================================================================
52
//
53
// Internal methods.
54
//
55
// ==================================================================
56
// ==================================================================
57
//
58
// Publics methods.
59
//
60
// ==================================================================
61
/**
62      * This method allows the assembly manager to register itself
63      * to its parent AssemblyFactory
64      * @param assembly_manager The AssemblyManager to register
65      * @return A cookie connection
66      */

67     public org.omg.Components.Cookie
68     register_assembly_manager(org.objectweb.openccm
69                                .OpenCCM_DCI.AssemblyManager assembly_manager)
70     {
71         try{
72             // Connect the assembly manager
73
return
74                 ((org.objectweb.openccm
75                   .OpenCCM_DCI.AssemblyFactoryManagerCCM)get_context())
76                 .connect_assembly_managers(assembly_manager) ;
77                 
78         }
79         catch(Exception JavaDoc e){
80             System.err.println("Error occured during the AssemblyManager connection");
81             e.printStackTrace();
82         }
83         return null;
84     }
85
86     /**
87      * This method allows a AssemblyManager to unregister itself
88      * from its parent AssemblyFactory
89      * @param cookie The cookie connection
90      */

91     public void
92     unregister_assembly_manager(org.omg.Components.Cookie cookie)
93         throws org.omg.Components.CookieRequired
94     {
95         try{
96             //Disconnect the assembly manager
97
((org.objectweb.openccm
98                  .OpenCCM_DCI.AssemblyFactoryManagerCCM)get_context())
99                    .disconnect_assembly_managers(cookie);
100         }
101         catch(Exception JavaDoc e){
102             e.printStackTrace();
103             throw new org.omg.Components.CookieRequired();
104         }
105     }
106 }
107
Popular Tags