sources:
Helper.h (741 bytes)
HomeFinder.cpp (2.9k)
HomeFinder_Impl.cpp (3.2k)
HomeFinder_Impl.h (1.6k)
ccm.cpp (389.7k)
ccm.h (127.0k)
home.idl (11.9k)
home_old.idl (312 bytes)


website:
more info here
studies/corba/Corba-Code6/home.idl
download file

  1 /* * Mico --- a free CORBA implementation * Copyright Frank Pilhofer * * This file is part of MicoCCM, written by Frank Pilhofer. * The MICO CORBA Component Project was sponsored by Alcatel. */
  2
  3 module Components {
  4
  5   typePrefix Components "omg.org";
  6
  7   /* * ---------------------------------------------------------------------- * External Interfaces * ---------------------------------------------------------------------- */
  8
  9   /* * Base Types */
 10
 11   typedef string FeatureName;
 12   typedef sequence<FeatureName> NameList;
 13
 14   exception InvalidName {};
 15   exception InvalidConfiguration {};
 16   exception AlreadyConnected {};
 17   exception InvalidConnection {};
 18   exception NoConnection {};
 19   exception ExceededConnectionLimit {};
 20   exception CookieRequired {};
 21
 22   valuetype PortDescription {
 23     public FeatureName name;
 24     public string type_id;
 25   };
 26
 27   valuetype Cookie {
 28     public sequence<octet> CookieValue;
 29   };
 30
 31   abstract valuetype EventBase {};
 32
 33   /* * Facets */
 34
 35   valuetype FacetDescription : PortDescription {
 36     public Object facet_ref;
 37   };
 38
 39   typedef sequence<FacetDescription> FacetDescriptions;
 40
 41   interface Navigation {
 42     Object provide_facet (in FeatureName name)
 43       raises (InvalidName);
 44
 45     FacetDescriptions get_all_facets ();
 46
 47     FacetDescriptions get_named_facets (in NameList names)
 48       raises (InvalidName);
 49
 50     boolean same_component (in Object ref);
 51   };
 52
 53   /* * Receptacles */
 54
 55   valuetype ConnectionDescription {
 56     public Cookie ck;
 57     public Object objref;
 58   };
 59
 60   typedef sequence<ConnectionDescription> ConnectionDescriptions;
 61
 62   valuetype ReceptacleDescription : PortDescription {
 63     public boolean is_multiplex;
 64     public ConnectionDescriptions connections;
 65   };
 66
 67   typedef sequence<ReceptacleDescription> ReceptacleDescriptions;
 68
 69   interface Receptacles {
 70     Cookie connect (in FeatureName name, in Object connection)
 71       raises (InvalidName, InvalidConnection,
 72           AlreadyConnected, ExceededConnectionLimit)
;
 73
 74     void disconnect (in FeatureName name, in Cookie ck)
 75       raises (InvalidName, InvalidConnection,
 76           CookieRequired, NoConnection)
;
 77
 78     ConnectionDescriptions get_connections (in FeatureName name)
 79       raises (InvalidName);
 80
 81     ReceptacleDescriptions get_all_receptacles ();
 82
 83     ReceptacleDescriptions get_named_receptacles (in NameList names)
 84       raises (InvalidName);
 85   };
 86
 87   /* * Events */
 88
 89   exception BadEventType {
 90     string expected_event_type;
 91   };
 92
 93   interface EventConsumerBase {
 94     void push_event (in EventBase evt)
 95       raises (BadEventType);
 96   };
 97
 98   // for consumer ports
 99
100   valuetype ConsumerDescription : PortDescription {
101     public EventConsumerBase consumer;
102   };
103
104   typedef sequence<ConsumerDescription> ConsumerDescriptions;
105
106   // for emitter ports
107
108   valuetype EmitterDescription : PortDescription {
109     public EventConsumerBase consumer;
110   };
111
112   typedef sequence<EmitterDescription> EmitterDescriptions;
113
114   // for publisher ports
115
116   valuetype SubscriberDescription {
117     public Cookie ck;
118     public EventConsumerBase consumer;
119   };
120
121   typedef sequence<SubscriberDescription> SubscriberDescriptions;
122
123   valuetype PublisherDescription : PortDescription {
124     public SubscriberDescriptions consumers;
125   };
126
127   typedef sequence<PublisherDescription> PublisherDescriptions;
128
129   // events interface
130
131   interface Events {
132     EventConsumerBase get_consumer (in FeatureName sink_name)
133       raises (InvalidName);
134
135     // for consumer ports
136
137     ConsumerDescriptions get_all_consumers ();
138
139     ConsumerDescriptions get_named_consumers (in NameList names);
140
141     // for publisher ports
142
143     Cookie subscribe (in FeatureName publisher_name,
144               in EventConsumerBase subscriber)

145       raises (InvalidName);
146
147     void unsubscribe (in FeatureName publisher_name,
148               in Cookie ck)

149       raises (InvalidName, InvalidConnection);
150
151     PublisherDescriptions get_all_publishers ();
152
153     PublisherDescriptions get_named_publishers (in NameList names);
154
155     // for emitter ports
156
157     void connect_consumer (in FeatureName emitter_name,
158                in EventConsumerBase consumer)

159       raises (InvalidName, AlreadyConnected);
160
161     EventConsumerBase disconnect_consumer (in FeatureName source_name)
162       raises (InvalidName, NoConnection);
163
164     EmitterDescriptions get_all_emitters ();
165
166     EmitterDescriptions get_named_emitters (in NameList names);
167
168   };
169
170   /* * CCMObject */
171
172   interface CCMHome;
173
174   valuetype ComponentPortDescription {
175     public FacetDescriptions facets;
176     public ReceptacleDescriptions receptacles;
177     public ConsumerDescriptions consumers;
178     public EmitterDescriptions emitters;
179     public PublisherDescriptions publishers;
180   };
181
182   interface CCMObject : Navigation, Receptacles, Events {
183     Object get_component_def ();
184     CCMHome get_ccm_home ();
185     /* PrimaryKeyBase get_primary_key (); */
186     void configuration_complete ();
187     void remove ();
188     ComponentPortDescription get_all_ports ();
189   };
190
191   /* * Homes */
192
193   exception DuplicateKeyValue {};
194   exception UnknownKeyValue {};
195   exception InvalidKey {};
196
197   interface CCMHome {
198     Object get_component_def ();
199     Object get_home_def ();
200     void remove_component (in CCMObject comp);
201   };
202
203   typedef sequence<CCMHome> CCMHomes;
204
205   interface KeylessCCMHome {
206     CCMObject create_component ();
207   };
208
209   exception HomeNotFound {};
210
211   interface HomeFinder {
212     CCMHome find_home_by_component_type (in string comp_repid)
213       raises (HomeNotFound);
214     CCMHome find_home_by_home_type (in string home_repid)
215       raises (HomeNotFound);
216     CCMHome find_home_by_name (in string home_name);
217   };
218
219   /* * Configurator */
220
221   exception WrongComponentType {};
222
223   interface Configurator {
224     void configure (in CCMObject comp)
225       raises (WrongComponentType);
226   };
227
228   valuetype ConfigValue {
229     public FeatureName name;
230     public any value;
231   };
232
233   typedef sequence<ConfigValue> ConfigValues;
234
235   interface StandardConfigurator : Configurator {
236     void set_configuration (in ConfigValues descr);
237   };
238
239   /* * ---------------------------------------------------------------------- * Internal Interfaces * ---------------------------------------------------------------------- */
240
241   /* * Context */
242
243   /* * typedef SecurityLevel2::Credentials Principal; */
244
245   exception IllegalState {};
246
247   local interface CCMContext {
248     /* * Principal get_caller_principal (); * boolean get_rollback_only () * Transaction::UserTransaction get_user_transaction (); * boolean is_caller_in_role (string role); * void set_rollback_only (); */
249     CCMHome get_CCM_home ();
250   };
251
252   local interface SessionContext : CCMContext {
253     Object get_CCM_object () raises (IllegalState);
254   };
255
256   /* * ---------------------------------------------------------------------- * Callback Interfaces * ---------------------------------------------------------------------- */
257
258   /* * Component base interfaces */
259
260   enum CCMExceptionReason {
261     SYSTEM_ERROR,
262     CREATE_ERROR,
263     REMOVE_ERROR,
264     DUPLICATE_KEY,
265     FIND_ERROR,
266     OBJECT_NOT_FOUND,
267     NO_SUCH_ENTITY
268   };
269
270   exception CCMException {
271     CCMExceptionReason reason;
272   };
273
274   local interface EnterpriseComponent {
275   };
276
277   local interface SessionComponent : EnterpriseComponent {
278     void set_session_context (in SessionContext ctx)
279       raises (CCMException);
280     void ccm_activate () raises (CCMException);
281     void ccm_passivate () raises (CCMException);
282     void ccm_remove () raises (CCMException);
283   };
284
285   local interface HomeExecutorBase {
286   };
287
288   local interface ExecutorLocator : EnterpriseComponent {
289     Object obtain_executor (in string name)
290       raises (CCMException);
291     void release_executor (in Object exc)
292       raises (CCMException);
293     void configurationComplete ()
294       raises (InvalidConfiguration);
295   };
296
297   /* * ---------------------------------------------------------------------- * Deployment Interfaces * ---------------------------------------------------------------------- */
298
299   exception UnknownImplId {};
300   exception InvalidLocation {};
301   exception CreateFailure {};
302   exception RemoveFailure {};
303   exception InstallationFailure {};
304   exception InvalidAssembly {};
305
306   interface Container;
307   typedef sequence<Container> Containers;
308
309   interface ComponentServer;
310   typedef sequence<ComponentServer> ComponentServers;
311
312   typedef string UUID;
313   typedef string Location;
314
315   interface ComponentInstallation {
316     void install (in UUID implUUID, in Location component_loc)
317       raises (InvalidLocation, InstallationFailure);
318     void replace (in UUID implUUID, in Location component_loc)
319       raises (InvalidLocation, InstallationFailure);
320     void remove (in UUID implUUID)
321       raises (UnknownImplId, RemoveFailure);
322     Location get_implementation (in UUID implUUID)
323       raises (UnknownImplId, InstallationFailure);
324   };
325
326   interface Assembly;
327   interface AssemblyFactory {
328     Cookie create (in Location assembly_loc)
329       raises (InvalidLocation, CreateFailure);
330     Assembly lookup (in Cookie c)
331       raises (InvalidAssembly);
332     void destroy (in Cookie c)
333       raises (InvalidAssembly, RemoveFailure);
334   };
335
336   enum AssemblyState {
337     INACTIVE,
338     INSERVICE
339   };
340
341   interface Assembly {
342     void build () raises (CreateFailure);
343     void tear_down () raises (RemoveFailure);
344     AssemblyState get_state ();
345   };
346
347   interface ServerActivator {
348     ComponentServer create_component_server (in ConfigValues config)
349       raises (CreateFailure, InvalidConfiguration);
350     void remove_component_server (in ComponentServer server)
351       raises (RemoveFailure);
352     ComponentServers get_component_servers ();
353   };
354
355   interface ComponentServer {
356     readonly attribute ConfigValues configuration;
357     ServerActivator get_server_activator ();
358     Container create_container (in ConfigValues config)
359       raises (CreateFailure, InvalidConfiguration);
360     void remove_container (in Container cref)
361       raises (RemoveFailure);
362     Containers get_containers ();
363     void remove ()
364       raises (RemoveFailure);
365   };
366
367   interface Container {
368     readonly attribute ConfigValues configuration;
369     ComponentServer get_component_server ();
370     CCMHome install_home (in string id,
371               in string entrypt,
372               in ConfigValues config)

373       raises (InvalidConfiguration, InstallationFailure);
374     void remove_home (in CCMHome href)
375       raises (RemoveFailure);
376     CCMHomes get_homes ();
377     void remove ()
378       raises (RemoveFailure);
379   };
380 };
381
382 /* * Need private versions of ServerActivator and ComponentServer * to facilitate interprocess communication between them. * * The ServerActivator needs to set ConfigValues upon ComponentServer, * and ConfigValues needs to call back ServerActivator with its object * reference after startup. * * The MicoCCMD interface implements the ServerActivator, Component- * Installation and AssemblyFactory interfaces. */
383
384 module MICOCCM {
385
386   typePrefix MICOCCM "mico.org";
387
388   interface MicoCCMD :
389     Components::ServerActivator,
390     Components::ComponentInstallation,
391     Components::AssemblyFactory
392   {
393     Object exec (in string prog, in Components::NameList args,
394          in string iorfile)

395       raises (Components::CreateFailure);
396     void callback (in string token, in Object csref);
397   };
398
399   interface ComponentServer : Components::ComponentServer {
400     void set_config_values (in Components::ConfigValues config);
401   };
402 };
403
404 module HPI{
405   interface HomeFinder:Components::HomeFinder{
406     long register(in string comp_repid,
407                   in string home_repid,
408           in Components::CCMHome the_home)
;
409     void unregister(in long cookie)
410                   raises (Components::HomeNotFound);
411   };
412 };
413