KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > ir3 > ComponentModuleDef_impl


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2004 INRIA & USTL - LIFL - GOAL
5 Contact: openccm@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): Philippe Merle.
23 Contributor(s): Mathieu Vadet, Sylvain Leblanc, Christophe Demarey.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.ir3;
28
29 /**
30  * Implementation of the CORBA::ComponentIR::ModuleDef interface.
31  *
32  * @author <a=href="Philippe.Merle@lifl.fr">Philippe Merle</a>
33  * <a=href="Mathieu.Vadet@lifl.fr">Mathieu Vadet</a>
34  *
35  * @version 0.3
36  */

37
38 public class ComponentModuleDef_impl
39        extends ModuleDef_impl
40        implements org.omg.CORBA.ComponentIR.ModuleDefOperations
41 {
42     // ==================================================================
43
//
44
// Internal state.
45
//
46
// ==================================================================
47

48     // ==================================================================
49
//
50
// Constructor.
51
//
52
// ==================================================================
53

54     /**
55      * Default constructor.
56      */

57     public
58     ComponentModuleDef_impl(IFR ifr,
59                             Container_impl container)
60     {
61         // call the ModuleDef_impl contructor.
62
super(ifr, container);
63
64         // set the tie servant object.
65
setServant(new org.omg.CORBA.ComponentIR.ModuleDefPOATie(this));
66     }
67
68     // ==================================================================
69
//
70
// Public methods.
71
//
72
// ==================================================================
73

74     /**
75      * Obtain its CORBA::ComponentIR::ModuleDef object reference.
76      */

77     public org.omg.CORBA.ComponentIR.ModuleDef
78     asComponentModuleDef()
79     {
80         return org.omg.CORBA.ComponentIR.ModuleDefHelper.narrow(asObject());
81     }
82
83     // ==================================================================
84
//
85
// For CORBA::ComponentIR::Container interface.
86
//
87
// ==================================================================
88

89     /**
90      * IDL:omg.org/CORBA/ComponentIR/Container/create_component_module:1.0
91      */

92     public org.omg.CORBA.ComponentIR.ModuleDef
93     create_component_module(String JavaDoc id,
94                             String JavaDoc name,
95                             String JavaDoc version)
96     {
97         ComponentModuleDef_impl module = new ComponentModuleDef_impl(getIFR(), this);
98
99         try
100         {
101             addContained(module, id, name, version);
102         }
103         catch(org.omg.CORBA.SystemException JavaDoc exc)
104         {
105             module.destroy();
106             throw exc;
107         }
108
109         return module.asComponentModuleDef();
110     }
111
112     /**
113      * IDL:omg.org/CORBA/ComponentIR/Container/create_component:1.0
114      */

115     public org.omg.CORBA.ComponentIR.ComponentDef
116     create_component(String JavaDoc id,
117                      String JavaDoc name,
118                      String JavaDoc version,
119                      org.omg.CORBA.ComponentIR.ComponentDef base_component,
120                      org.omg.CORBA.InterfaceDef JavaDoc[] supported_interfaces)
121     {
122         ComponentDef_impl c = new ComponentDef_impl(getIFR(), this);
123         try
124         {
125             addContained(c, id, name, version);
126             c.base_component(base_component);
127             c.supported_interfaces(supported_interfaces);
128         }
129         catch(org.omg.CORBA.SystemException JavaDoc exc)
130         {
131             c.destroy();
132             throw exc;
133         }
134
135         c.whenCreated();
136         return c.asComponentDef();
137     }
138
139     /**
140      * IDL:omg.org/CORBA/ComponentIR/Container/create_home:1.0
141      */

142     public org.omg.CORBA.ComponentIR.HomeDef
143     create_home(String JavaDoc id,
144                 String JavaDoc name,
145                 String JavaDoc version,
146                 org.omg.CORBA.ComponentIR.HomeDef base_home,
147                 org.omg.CORBA.ComponentIR.ComponentDef managed_component,
148                 org.omg.CORBA.InterfaceDef JavaDoc[] supported_interfaces,
149                 org.omg.CORBA.ValueDef JavaDoc primary_key)
150     {
151         HomeDef_impl h = new HomeDef_impl(getIFR(), this);
152
153         try
154         {
155             addContained(h, id, name, version);
156             h.base_home(base_home);
157             h.managed_component(managed_component);
158             h.supported_interfaces(supported_interfaces);
159             h.primary_key(primary_key);
160         }
161         catch(org.omg.CORBA.SystemException JavaDoc exc)
162         {
163             h.destroy();
164             throw exc;
165         }
166
167         h.whenCreated();
168         return h.asHomeDef();
169     }
170
171     /**
172      * IDL:omg.org/CORBA/ComponentIR/Container/create_value:1.0
173      */

174     public org.omg.CORBA.ComponentIR.EventDef
175     create_event(String JavaDoc id,
176                  String JavaDoc name,
177                  String JavaDoc version,
178                  boolean is_custom,
179                  boolean is_abstract,
180                  org.omg.CORBA.ValueDef JavaDoc base_value,
181                  boolean is_truncatable,
182                  org.omg.CORBA.ValueDef JavaDoc[] abstract_base_values,
183                  org.omg.CORBA.InterfaceDef JavaDoc[] supported_interfaces,
184                  org.omg.CORBA.ExtInitializer[] initializers)
185     {
186         EventDef_impl event = new EventDef_impl(getIFR(), this);
187
188         try
189         {
190             addContained(event, id, name, version);
191             event.is_custom(is_custom);
192             event.is_abstract(is_abstract);
193             event.base_value(base_value);
194             event.is_truncatable(is_truncatable);
195             event.abstract_base_values(abstract_base_values);
196             event.supported_interfaces(supported_interfaces);
197             event.ext_initializers(initializers);
198         }
199         catch(org.omg.CORBA.SystemException JavaDoc exc)
200         {
201             event.destroy();
202             throw exc;
203         }
204
205         event.whenCreated();
206         return event.asEventDef();
207    }
208 }
209
Popular Tags