diff options
-rw-r--r-- | TAO/orbsvcs/orbsvcs/LB_ObjectGroup_Map.cpp | 10 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/LB_ObjectGroup_Map.h | 16 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/LB_PropertyManager.h | 32 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ObjectGroup_Map.cpp | 10 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ObjectGroup_Map.h | 16 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/LoadBalancing/LB_PropertyManager.h | 32 |
6 files changed, 88 insertions, 28 deletions
diff --git a/TAO/orbsvcs/orbsvcs/LB_ObjectGroup_Map.cpp b/TAO/orbsvcs/orbsvcs/LB_ObjectGroup_Map.cpp index 7bbd90b959d..621492d2b74 100644 --- a/TAO/orbsvcs/orbsvcs/LB_ObjectGroup_Map.cpp +++ b/TAO/orbsvcs/orbsvcs/LB_ObjectGroup_Map.cpp @@ -7,6 +7,16 @@ ACE_RCSID (LoadBalancing, "$Id$") +TAO_LB_ObjectGroup_Map_Entry::TAO_LB_ObjectGroup_Map_Entry (void) + : type_id (), + object_group (), + replica_infos (), + creation_properties (), + dynamic_properties (0), + lock () +{ +} + #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Hash_Map_Entry<PortableServer::ObjectId, TAO_LB_ObjectGroup_Map_Entry *>; diff --git a/TAO/orbsvcs/orbsvcs/LB_ObjectGroup_Map.h b/TAO/orbsvcs/orbsvcs/LB_ObjectGroup_Map.h index 59496d94772..347b816dbe9 100644 --- a/TAO/orbsvcs/orbsvcs/LB_ObjectGroup_Map.h +++ b/TAO/orbsvcs/orbsvcs/LB_ObjectGroup_Map.h @@ -34,8 +34,15 @@ * * @brief Value field of the ObjectGroup map. */ -struct TAO_LB_ObjectGroup_Map_Entry +class TAO_LB_ObjectGroup_Map_Entry { +public: + + /// Constructor + TAO_LB_ObjectGroup_Map_Entry (void); + +public: + /// The RepositoryId corresponding to all Replicas in the /// ObjectGroup. CORBA::String_var type_id; @@ -47,6 +54,13 @@ struct TAO_LB_ObjectGroup_Map_Entry /// information for each replica. TAO_LB_ReplicaInfo_Set replica_infos; + /// Properties used when creating this object group. + LoadBalancing::Properties creation_properties; + + /// Properties set for this object group after this object group was + /// created. + LoadBalancing::Properties *dynamic_properties; + /// Lock used to synchronize access to the ReplicaInfo set. TAO_SYNCH_MUTEX lock; }; diff --git a/TAO/orbsvcs/orbsvcs/LB_PropertyManager.h b/TAO/orbsvcs/orbsvcs/LB_PropertyManager.h index 493d42859e4..d98bf0061c4 100644 --- a/TAO/orbsvcs/orbsvcs/LB_PropertyManager.h +++ b/TAO/orbsvcs/orbsvcs/LB_PropertyManager.h @@ -114,6 +114,14 @@ public: //@} + + /// Verify that the given properties are valid and/or supported by + /// the Load Balancer. + void validate_properties (const LoadBalancing::Properties &props, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((LoadBalancing::InvalidProperty, + LoadBalancing::UnsupportedProperty)); + /** * @name TAO-specific Load Balancing PropertyManager Helper Methods * @@ -129,12 +137,12 @@ public: CORBA::Object_ptr object_group) const; /// Return the load monitoring style for the given object group. - LoadBalancing::LoadMonitoringStyle load_monitoring_style ( + LoadBalancing::MonitoringStyle load_monitoring_style ( CORBA::Object_ptr object_group) const; /// Return the load monitoring granularity for the given object /// group. - LoadBalancing::LoadMonitoringGranularity + LoadBalancing::MonitoringGranularity load_monitoring_granularity (CORBA::Object_ptr object_group) const; /// Return the initial number of replicas for the given object @@ -147,14 +155,19 @@ public: LoadBalancing::MinimumNumberReplicas minimum_number_replicas (CORBA::Object_ptr object_group) const; + /// Return the sequence FactoryInfos associated with the given + /// object group. + LoadBalancing::FactoryInfos * + factory_infos (CORBA::Object_ptr object_group) const; + //@} /// Type-specific property hash map. typedef ACE_Hash_Map_Manager_Ex< - const ACE_TCHAR *, + const char *, LoadBalancing::Properties, - ACE_Hash<const ACE_TCHAR *>, - ACE_Equal_To<const ACE_TCHAR *>, + ACE_Hash<const char *>, + ACE_Equal_To<const char *>, TAO_SYNCH_MUTEX> Type_Prop_Table; /// Properties used when a given object group was created. @@ -163,10 +176,7 @@ public: LoadBalancing::Properties, TAO_ObjectId_Hash, ACE_Equal_To<PortableServer::ObjectId>, - TAO_SYNCH_MUTEX> Creation_Prop_Table; - - /// Properties set at run time - typedef Creation_Prop_Table Dynamic_Prop_Table; + TAO_SYNCH_MUTEX> Dynamic_Prop_Table; private: @@ -176,10 +186,6 @@ private: /// Table of type-specific object group properties. Type_Prop_Table type_properties_; - /// Table of object group properties used when the object group was - /// created. - Creation_Prop_Table creation_properties_; - /// Table of object group properties used at run-time. Dynamic_Prop_Table dynamic_properties_; diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ObjectGroup_Map.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ObjectGroup_Map.cpp index 7bbd90b959d..621492d2b74 100644 --- a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ObjectGroup_Map.cpp +++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ObjectGroup_Map.cpp @@ -7,6 +7,16 @@ ACE_RCSID (LoadBalancing, "$Id$") +TAO_LB_ObjectGroup_Map_Entry::TAO_LB_ObjectGroup_Map_Entry (void) + : type_id (), + object_group (), + replica_infos (), + creation_properties (), + dynamic_properties (0), + lock () +{ +} + #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Hash_Map_Entry<PortableServer::ObjectId, TAO_LB_ObjectGroup_Map_Entry *>; diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ObjectGroup_Map.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ObjectGroup_Map.h index 59496d94772..347b816dbe9 100644 --- a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ObjectGroup_Map.h +++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ObjectGroup_Map.h @@ -34,8 +34,15 @@ * * @brief Value field of the ObjectGroup map. */ -struct TAO_LB_ObjectGroup_Map_Entry +class TAO_LB_ObjectGroup_Map_Entry { +public: + + /// Constructor + TAO_LB_ObjectGroup_Map_Entry (void); + +public: + /// The RepositoryId corresponding to all Replicas in the /// ObjectGroup. CORBA::String_var type_id; @@ -47,6 +54,13 @@ struct TAO_LB_ObjectGroup_Map_Entry /// information for each replica. TAO_LB_ReplicaInfo_Set replica_infos; + /// Properties used when creating this object group. + LoadBalancing::Properties creation_properties; + + /// Properties set for this object group after this object group was + /// created. + LoadBalancing::Properties *dynamic_properties; + /// Lock used to synchronize access to the ReplicaInfo set. TAO_SYNCH_MUTEX lock; }; diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_PropertyManager.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_PropertyManager.h index 493d42859e4..d98bf0061c4 100644 --- a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_PropertyManager.h +++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_PropertyManager.h @@ -114,6 +114,14 @@ public: //@} + + /// Verify that the given properties are valid and/or supported by + /// the Load Balancer. + void validate_properties (const LoadBalancing::Properties &props, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((LoadBalancing::InvalidProperty, + LoadBalancing::UnsupportedProperty)); + /** * @name TAO-specific Load Balancing PropertyManager Helper Methods * @@ -129,12 +137,12 @@ public: CORBA::Object_ptr object_group) const; /// Return the load monitoring style for the given object group. - LoadBalancing::LoadMonitoringStyle load_monitoring_style ( + LoadBalancing::MonitoringStyle load_monitoring_style ( CORBA::Object_ptr object_group) const; /// Return the load monitoring granularity for the given object /// group. - LoadBalancing::LoadMonitoringGranularity + LoadBalancing::MonitoringGranularity load_monitoring_granularity (CORBA::Object_ptr object_group) const; /// Return the initial number of replicas for the given object @@ -147,14 +155,19 @@ public: LoadBalancing::MinimumNumberReplicas minimum_number_replicas (CORBA::Object_ptr object_group) const; + /// Return the sequence FactoryInfos associated with the given + /// object group. + LoadBalancing::FactoryInfos * + factory_infos (CORBA::Object_ptr object_group) const; + //@} /// Type-specific property hash map. typedef ACE_Hash_Map_Manager_Ex< - const ACE_TCHAR *, + const char *, LoadBalancing::Properties, - ACE_Hash<const ACE_TCHAR *>, - ACE_Equal_To<const ACE_TCHAR *>, + ACE_Hash<const char *>, + ACE_Equal_To<const char *>, TAO_SYNCH_MUTEX> Type_Prop_Table; /// Properties used when a given object group was created. @@ -163,10 +176,7 @@ public: LoadBalancing::Properties, TAO_ObjectId_Hash, ACE_Equal_To<PortableServer::ObjectId>, - TAO_SYNCH_MUTEX> Creation_Prop_Table; - - /// Properties set at run time - typedef Creation_Prop_Table Dynamic_Prop_Table; + TAO_SYNCH_MUTEX> Dynamic_Prop_Table; private: @@ -176,10 +186,6 @@ private: /// Table of type-specific object group properties. Type_Prop_Table type_properties_; - /// Table of object group properties used when the object group was - /// created. - Creation_Prop_Table creation_properties_; - /// Table of object group properties used at run-time. Dynamic_Prop_Table dynamic_properties_; |