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   exception CCMException {
270     CCMExceptionReason reason;
271   };
272
273   local interface EnterpriseComponent {
274   };
275
276   local interface SessionComponent : EnterpriseComponent {
277     void set_session_context (in SessionContext ctx)
278       raises (CCMException);
279     void ccm_activate () raises (CCMException);
280     void ccm_passivate () raises (CCMException);
281     void ccm_remove () raises (CCMException);
282   };
283
284   local interface HomeExecutorBase {
285   };
286
287   local interface ExecutorLocator : EnterpriseComponent {
288     Object obtain_executor (in string name)
289       raises (CCMException);
290     void release_executor (in Object exc)
291       raises (CCMException);
292     void configurationComplete ()
293       raises (InvalidConfiguration);
294   };
295
296   /* * ---------------------------------------------------------------------- * Deployment Interfaces * ---------------------------------------------------------------------- */
297
298   exception UnknownImplId {};
299   exception InvalidLocation {};
300   exception CreateFailure {};
301   exception RemoveFailure {};
302   exception InstallationFailure {};
303   exception InvalidAssembly {};
304
305   interface Container;
306   typedef sequence<Container> Containers;
307
308   interface ComponentServer;
309   typedef sequence<ComponentServer> ComponentServers;
310
311   typedef string UUID;
312   typedef string Location;
313
314   interface ComponentInstallation {
315     void install (in UUID implUUID, in Location component_loc)
316       raises (InvalidLocation, InstallationFailure);
317     void replace (in UUID implUUID, in Location component_loc)
318       raises (InvalidLocation, InstallationFailure);
319     void remove (in UUID implUUID)
320       raises (UnknownImplId, RemoveFailure);
321     Location get_implementation (in UUID implUUID)
322       raises (UnknownImplId, InstallationFailure);
323   };
324
325   interface Assembly;
326   interface AssemblyFactory {
327     Cookie create (in Location assembly_loc)
328       raises (InvalidLocation, CreateFailure);
329     Assembly lookup (in Cookie c)
330       raises (InvalidAssembly);
331     void destroy (in Cookie c)
332       raises (InvalidAssembly, RemoveFailure);
333   };
334
335   enum AssemblyState {
336     INACTIVE,
337     INSERVICE   };
338
339   interface Assembly {
340     void build () raises (CreateFailure);
341     void tear_down () raises (RemoveFailure);
342     AssemblyState get_state ();
343   };
344
345   interface ServerActivator {
346     ComponentServer create_component_server (in ConfigValues config)
347       raises (CreateFailure, InvalidConfiguration);
348     void remove_component_server (in ComponentServer server)
349       raises (RemoveFailure);
350     ComponentServers get_component_servers ();
351   };
352
353   interface ComponentServer {
354     readonly attribute ConfigValues configuration;
355     ServerActivator get_server_activator ();
356     Container create_container (in ConfigValues config)
357       raises (CreateFailure, InvalidConfiguration);
358     void remove_container (in Container cref)
359       raises (RemoveFailure);
360     Containers get_containers ();
361     void remove ()
362       raises (RemoveFailure);
363   };
364
365   interface Container {
366     readonly attribute ConfigValues configuration;
367     ComponentServer get_component_server ();
368     CCMHome install_home (in string id,
369               in string entrypt,
370               in ConfigValues config)

371       raises (InvalidConfiguration, InstallationFailure);
372     void remove_home (in CCMHome href)
373       raises (RemoveFailure);
374     CCMHomes get_homes ();
375     void remove ()
376       raises (RemoveFailure);
377   };
378 };
379
380 /* * 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. */
381
382 module MICOCCM {
383
384   typePrefix MICOCCM "mico.org";
385
386   interface MicoCCMD :
387     Components::ServerActivator,
388     Components::ComponentInstallation,
389     Components::AssemblyFactory   {
390     Object exec (in string prog, in Components::NameList args,
391          in string iorfile)

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