PortableGroup.idl

Go to the documentation of this file.
00001 // -*- IDL -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    PortableGroup.idl
00006  *
00007  *  PortableGroup.idl,v 1.12 2005/02/18 09:07:07 jwillemsen Exp
00008  */
00009 //=============================================================================
00010 
00011 #ifndef _PORTABLEGROUP_IDL_
00012 #define _PORTABLEGROUP_IDL_
00013 
00014 #include "tao/PortableServer/PortableServer_include.pidl"
00015 #include "CosNaming.idl"
00016 #include "tao/IOP.pidl"
00017 #include "tao/GIOP.pidl"
00018 #include <orb.idl>
00019 #include "PortableGroup_Simple_DS.idl"
00020 
00021 module PortableGroup
00022 {
00023   typeprefix PortableGroup "omg.org";
00024 
00025   /// MembershipStyle
00026   const string PG_MEMBERSHIP_STYLE =
00027   "org.omg.PortableGroup.MembershipStyle";
00028 
00029   /// InitialNumberMembers
00030   const string PG_INITIAL_NUMBER_MEMBERS =
00031   "org.omg.PortableGroup.InitialNumberMembers";
00032 
00033   /// MinimumNumberMembers
00034   const string PG_MINIMUM_NUMBER_MEMBERS =
00035   "org.omg.PortableGroup.MinimumNumberMembers";
00036 
00037   /// Factories
00038   const string PG_FACTORIES = "org.omg.PortableGroup.Factories";
00039 
00040   typedef sequence <octet> GroupIIOPProfile; // tag = TAG_GROUP_IIOP
00041 
00042   // Specification of Common Types and Exceptions for Group Management
00043   interface GenericFactory;
00044 
00045   typedef CORBA::RepositoryId _TypeId;
00046   typedef Object ObjectGroup;
00047   typedef sequence<ObjectGroup> ObjectGroups;
00048   typedef CosNaming::Name Name;
00049   typedef any Value;
00050 
00051   struct Property {
00052     Name nam;
00053     Value val;
00054   };
00055 
00056   typedef sequence<Property> Properties;
00057   typedef Name Location;
00058   typedef sequence<Location> Locations;
00059   typedef Properties Criteria;
00060 
00061   struct FactoryInfo {
00062     GenericFactory the_factory;
00063     Location the_location;
00064     Criteria the_criteria;
00065   };
00066   typedef sequence<FactoryInfo> FactoryInfos;
00067 
00068   typedef long MembershipStyleValue;
00069   const MembershipStyleValue MEMB_APP_CTRL = 0;
00070   const MembershipStyleValue MEMB_INF_CTRL = 1;
00071 
00072   typedef FactoryInfos FactoriesValue;
00073   typedef unsigned short InitialNumberMembersValue;
00074   typedef unsigned short MinimumNumberMembersValue;
00075 
00076   exception InterfaceNotFound {};
00077   exception ObjectGroupNotFound {};
00078   exception MemberNotFound {};
00079   exception ObjectNotFound {};
00080   exception MemberAlreadyPresent {};
00081   exception ObjectNotCreated {};
00082   exception ObjectNotAdded {};
00083   /// TAO Specific: TypeConfict exception
00084   exception TypeConflict {};
00085   exception UnsupportedProperty {
00086     Name nam;
00087     Value val;
00088   };
00089 
00090   exception InvalidProperty {
00091     Name nam;
00092     Value val;
00093   };
00094 
00095   exception NoFactory {
00096     Location the_location;
00097     _TypeId type_id;
00098   };
00099 
00100   exception InvalidCriteria {
00101     Criteria invalid_criteria;
00102   };
00103 
00104   exception CannotMeetCriteria {
00105     Criteria unmet_criteria;
00106   };
00107 
00108   // Specification of PropertyManager Interface
00109   interface PropertyManager {
00110 
00111     void set_default_properties (in Properties props)
00112       raises (InvalidProperty, UnsupportedProperty);
00113 
00114     Properties get_default_properties();
00115 
00116     void remove_default_properties (in Properties props)
00117       raises (InvalidProperty, UnsupportedProperty);
00118 
00119     void set_type_properties (in _TypeId type_id, in Properties overrides)
00120       raises (InvalidProperty, UnsupportedProperty);
00121 
00122     Properties get_type_properties(in _TypeId type_id);
00123 
00124     void remove_type_properties (in _TypeId type_id, in Properties props)
00125       raises (InvalidProperty, UnsupportedProperty);
00126 
00127     void set_properties_dynamically
00128       (in ObjectGroup object_group, in Properties overrides)
00129       raises (ObjectGroupNotFound,
00130               InvalidProperty,
00131               UnsupportedProperty);
00132 
00133     Properties get_properties (in ObjectGroup object_group)
00134       raises (ObjectGroupNotFound);
00135   }; // endPropertyManager
00136 
00137 
00138   // Specification of ObjectGroupManager Interface
00139   interface ObjectGroupManager {
00140     ObjectGroup create_member (in ObjectGroup object_group,
00141                                in Location the_location,
00142                                in _TypeId type_id,
00143                                in Criteria the_criteria)
00144       raises (ObjectGroupNotFound,
00145               MemberAlreadyPresent,
00146               NoFactory,
00147               ObjectNotCreated,
00148               InvalidCriteria,
00149               CannotMeetCriteria);
00150 
00151     ObjectGroup add_member (in ObjectGroup object_group,
00152                             in Location the_location,
00153                             in Object member)
00154       raises (ObjectGroupNotFound,
00155               MemberAlreadyPresent,
00156               ObjectNotAdded);
00157 
00158     ObjectGroup remove_member (in ObjectGroup object_group,
00159                                in Location the_location)
00160       raises (ObjectGroupNotFound, MemberNotFound);
00161 
00162     Locations locations_of_members (in ObjectGroup object_group)
00163       raises (ObjectGroupNotFound);
00164 
00165     ObjectGroups groups_at_location (in Location the_location);
00166 
00167     ObjectGroupId get_object_group_id (in ObjectGroup object_group)
00168       raises (ObjectGroupNotFound);
00169 
00170     ObjectGroup get_object_group_ref (in ObjectGroup object_group)
00171       raises (ObjectGroupNotFound);
00172 
00173     Object get_member_ref (in ObjectGroup object_group,
00174                            in Location loc)
00175       raises (ObjectGroupNotFound, MemberNotFound);
00176 
00177     // TAO-specific extension.
00178     ObjectGroup get_object_group_ref_from_id (
00179       in ObjectGroupId group_id)
00180       raises (ObjectGroupNotFound);
00181 
00182   }; // end ObjectGroupManager
00183 
00184 
00185   // Specification of GenericFactory Interface
00186   interface GenericFactory {
00187     typedef any FactoryCreationId;
00188 
00189     Object create_object (in _TypeId type_id,
00190                           in Criteria the_criteria,
00191                           out FactoryCreationId factory_creation_id)
00192       raises (NoFactory,
00193               ObjectNotCreated,
00194               InvalidCriteria,
00195               InvalidProperty,
00196               CannotMeetCriteria);
00197 
00198     void delete_object (in FactoryCreationId factory_creation_id)
00199       raises (ObjectNotFound);
00200 
00201   }; // end GenericFactory
00202 
00203   ///////////////////////
00204   // The following FactoryRegistry interface is not included in the OMG PortableGroup IDL.
00205   // It's an extension needed as part of implementing the FT CORBA specification.
00206 
00207 
00208   /**
00209    * a name for the role the object will play
00210    * This allows multiple objects that implement the same interface (TypeId)
00211    * to exist at a location as long as they play different roles.
00212    */
00213   typedef CORBA::Identifier RoleName;
00214 
00215   /**
00216    * Reserved criteria name for specifing role.
00217    */
00218   const string role_criterion = "org.omg.portablegroup.Role";
00219 
00220   /**
00221    * Interface to allow generic factories for replicas to register themselves.
00222    * Factories are distinguished by the role to be played by the created-object (role) and the
00223    * location at which they create the object (FactoryInfo.the_location)
00224    *
00225    * Because this is an extension to the FT CORBA specification applications that wish to
00226    * adhere to the specification as written should use the type id as the role name when
00227    * interacting with the FactoryRegistry.
00228    */
00229   interface FactoryRegistry
00230   {
00231     /**
00232      * register a factory to create objects of the given type
00233      * at the location given in the FactoryInfo.
00234      *
00235      * @param role the role the object-to-be-created plays.
00236      * @param type_id type id of the object-to-be-created.
00237      * @param factory_info information about the factory including its location.
00238      * @throws MemberAlreadyPresent if there is already a factory for this type of object
00239      *         at this location.
00240      * @throws TypeConflict if the specified type_id is different from the type_id previously
00241      *         registered for this role.
00242      */
00243     void register_factory(in RoleName role, in _TypeId type_id, in FactoryInfo factory_info)
00244       raises (MemberAlreadyPresent, TypeConflict);
00245 
00246     /**
00247      * Remove the registration of a factory.
00248      * @param role the role played by the object formerly created by this factory.
00249      * @param location where the factory formerly created objects.
00250      * @throws MemberNotPresent if no factory is available for the given role at this location.
00251      */
00252     void unregister_factory(in RoleName role, in Location the_location)
00253       raises (MemberNotFound);
00254 
00255     /**
00256      * Remove the registration of all factories that create a particular type of object.
00257      * If no factories exist for the given type, the registry is unchanged.
00258      * This is not an error.
00259      * @param type_id the type of object formerly created by the factories to be unregistered.
00260      */
00261     void unregister_factory_by_role(in RoleName role);
00262 
00263     /**
00264      * Remove the registration of all factories that create objects at a particular location.
00265      * If the location is unknown the registry is unchanged.
00266      * This is not an error.
00267      * @param location where the factories formerly created objects.
00268      */
00269     void unregister_factory_by_location(in Location the_location);
00270 
00271     /**
00272      * List all the factories that create objects that fill a given role
00273      * If the role is unknown, an empty list is returned.  This is not an error.
00274      * @param role the type of object the factories create.
00275      * @param type_id what type of object is created to fill this role.
00276      */
00277     FactoryInfos list_factories_by_role(in RoleName role, out _TypeId type_id);
00278 
00279     /**
00280      * List all the factories that create a objects at a given location.
00281      * If no factories are registered for this location, an empty list is returned.
00282      * This is not an error.
00283      * @param location where the factories create objects.
00284      */
00285     FactoryInfos list_factories_by_location(in Location the_location);
00286 
00287   }; // end of FactoryRegistry
00288 
00289 
00290   const string TAO_UPDATE_OBJECT_GROUP_METHOD_NAME = "tao_update_object_group";
00291 
00292   interface TAO_UpdateObjectGroup {
00293     /**
00294      *  Pseudo used method to update IOGR in Object Group Members
00295      *  TAO specific.  The CORBA spec. doesn't address the issue.
00296      */
00297     void tao_update_object_group (
00298         in string iogr,
00299         in PortableGroup::ObjectGroupRefVersion version,
00300         in boolean is_primary);
00301   };
00302 
00303   exception NotAGroupObject {};
00304   typedef sequence <PortableServer::ObjectId> IDs;
00305 
00306   local interface GOA : PortableServer::POA {
00307     PortableServer::ObjectId create_id_for_reference(in Object the_ref)
00308       raises (NotAGroupObject);
00309 
00310     IDs reference_to_ids(in Object the_ref)
00311       raises (NotAGroupObject);
00312 
00313     void associate_reference_with_id (in Object ref,
00314                                       in PortableServer::ObjectId oid)
00315       raises (NotAGroupObject);
00316 
00317     void disassociate_reference_with_id (in Object ref,
00318                                          in PortableServer::ObjectId oid)
00319       raises (NotAGroupObject);
00320   };
00321 }; // end PortableGroup
00322 
00323 #endif  /* _PORTABLEGROUP_IDL_ */

Generated on Thu Nov 9 14:03:34 2006 for TAO_PortableGroup by doxygen 1.3.6