diff options
Diffstat (limited to 'TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp')
-rw-r--r-- | TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp | 102 |
1 files changed, 44 insertions, 58 deletions
diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp index 704513567da..980460362a3 100644 --- a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp +++ b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp @@ -33,6 +33,9 @@ ACE_RCSID (FT_ReplicationManager, "$Id$") +#define SUPPORT_OLD_PROPERTY_MANAGER +//#define USE_OLD_PROPERTY_MANAGER + // Use this macro at the beginning of CORBA methods // to aid in debugging. #define METHOD_ENTRY(name) \ @@ -532,12 +535,13 @@ TAO::FT_ReplicationManager::set_default_properties ( PortableGroup::InvalidProperty, PortableGroup::UnsupportedProperty)) { +#ifdef SUPPORT_OLD_PROPERTY_MANAGER this->property_manager_.set_default_properties (props ACE_ENV_ARG_PARAMETER); ACE_CHECK; +#endif //SUPPORT_OLD_PROPERTY_MANAGER - // Alternative implementation - this->default_properties_.decode(props); + this->properties_support_.set_default_properties (props); //@@ validate properties? } @@ -546,17 +550,14 @@ TAO::FT_ReplicationManager::get_default_properties ( ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ( (CORBA::SystemException)) { -#if 0 +#ifdef USE_OLD_PROPERTY_MANAGER return this->property_manager_.get_default_properties ( ACE_ENV_SINGLE_ARG_PARAMETER); -#else - PortableGroup::Properties_var result; - ACE_NEW_THROW_EX ( result, PortableGroup::Properties(), CORBA::NO_MEMORY()); - this->default_properties_.export_properties (*result ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (PortableGroup::Properties::_nil()); - return result._retn (); -#endif +#else // USE_OLD_PROPERTY_MANAGER + return this->properties_support_.get_default_properties ( + ACE_ENV_SINGLE_ARG_PARAMETER); +#endif //USE _OLD_PROPERTY_MANAGER } void @@ -567,11 +568,13 @@ TAO::FT_ReplicationManager::remove_default_properties ( PortableGroup::InvalidProperty, PortableGroup::UnsupportedProperty)) { +#ifdef SUPPORT_OLD_PROPERTY_MANAGER this->property_manager_.remove_default_properties (props ACE_ENV_ARG_PARAMETER); ACE_CHECK; - - this->default_properties_.remove (props ACE_ENV_ARG_PARAMETER); +#endif //SUPPORT_OLD_PROPERTY_MANAGER + this->properties_support_.remove_default_properties (props + ACE_ENV_ARG_PARAMETER); } void @@ -583,24 +586,16 @@ TAO::FT_ReplicationManager::set_type_properties ( PortableGroup::InvalidProperty, PortableGroup::UnsupportedProperty)) { +#ifdef SUPPORT_OLD_PROPERTY_MANAGER this->property_manager_.set_type_properties (type_id, overrides ACE_ENV_ARG_PARAMETER); ACE_CHECK; - - - TAO_PG::Properties_Decoder * typeid_properties; - if ( 0 != this->typeid_properties_map_.find (type_id, typeid_properties)) - { - ACE_NEW_THROW_EX ( - typeid_properties, - TAO_PG::Properties_Decoder (overrides, & this->default_properties_), - CORBA::NO_MEMORY()); - this->typeid_properties_map_.bind (type_id, typeid_properties); - } - typeid_properties->clear (); - typeid_properties->decode (overrides ACE_ENV_ARG_PARAMETER); - ACE_CHECK; +#endif //SUPPORT_OLD_PROPERTY_MANAGER + this->properties_support_.set_type_properties ( + type_id, + overrides + ACE_ENV_ARG_PARAMETER); } PortableGroup::Properties * @@ -609,22 +604,15 @@ TAO::FT_ReplicationManager::get_type_properties ( ACE_ENV_ARG_DECL) ACE_THROW_SPEC ( (CORBA::SystemException)) { -#if 0 +#ifdef USE_OLD_PROPERTY_MANAGER return this->property_manager_.get_type_properties (type_id - ACE_ENV_ARG_PARAMETER); -#else - PortableGroup::Properties_var result; - ACE_NEW_THROW_EX (result, PortableGroup::Properties(), CORBA::NO_MEMORY ()); + ACE_ENV_ARG_PARAMETER); +#else // USE_OLD_PROPERTY_MANAGER + return this->properties_support_.get_type_properties (type_id + ACE_ENV_ARG_PARAMETER); - TAO_PG::Properties_Decoder * typeid_properties; - if ( 0 != this->typeid_properties_map_.find (type_id, typeid_properties)) - { - typeid_properties->export_properties (*result ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - return result._retn (); -#endif +#endif //USE_OLD_PROPERTY_MANAGER } void @@ -636,16 +624,15 @@ TAO::FT_ReplicationManager::remove_type_properties ( PortableGroup::InvalidProperty, PortableGroup::UnsupportedProperty)) { +#ifdef SUPPORT_OLD_PROPERTY_MANAGER this->property_manager_.remove_type_properties (type_id, props ACE_ENV_ARG_PARAMETER); - - TAO_PG::Properties_Decoder * typeid_properties; - if ( 0 != this->typeid_properties_map_.find (type_id, typeid_properties)) - { - typeid_properties->remove (props ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } +#endif //SUPPORT_OLD_PROPERTY_MANAGER + this->properties_support_.remove_type_properties ( + type_id, + props + ACE_ENV_ARG_PARAMETER); } void @@ -658,9 +645,12 @@ TAO::FT_ReplicationManager::set_properties_dynamically ( PortableGroup::InvalidProperty, PortableGroup::UnsupportedProperty)) { +#ifdef SUPPORT_OLD_PROPERTY_MANAGER this->property_manager_.set_properties_dynamically (object_group, overrides ACE_ENV_ARG_PARAMETER); + ACE_CHECK; +#endif //SUPPORT_OLD_PROPERTY_MANAGER TAO::PG_Object_Group * group = 0; if (this->object_group_map_.find_group (object_group, group)) @@ -681,11 +671,11 @@ TAO::FT_ReplicationManager::get_properties ( ACE_THROW_SPEC ( (CORBA::SystemException, PortableGroup::ObjectGroupNotFound)) { -#if 0 +#ifdef USE_OLD_PROPERTY_MANAGER return this->property_manager_.get_properties (object_group ACE_ENV_ARG_PARAMETER); -#else +#else // USE_OLD_PROPERTY_MANAGER PortableGroup::Properties_var result; ACE_NEW_THROW_EX (result, PortableGroup::Properties(), CORBA::NO_MEMORY ()); @@ -700,7 +690,7 @@ TAO::FT_ReplicationManager::get_properties ( ACE_THROW (PortableGroup::ObjectGroupNotFound ()); } return result._retn(); -#endif +#endif // USE_OLD_PROPERTY_MANAGER } @@ -973,15 +963,11 @@ TAO::FT_ReplicationManager::create_object ( // entry in our object group map // first find the properties for this type of object group - TAO_PG::Properties_Decoder * typeid_properties; - if ( 0 != this->typeid_properties_map_.find (type_id, typeid_properties)) - { - ACE_NEW_THROW_EX ( - typeid_properties, - TAO_PG::Properties_Decoder (& this->default_properties_), - CORBA::NO_MEMORY()); - this->typeid_properties_map_.bind (type_id, typeid_properties); - } + TAO_PG::Properties_Decoder * typeid_properties + = this->properties_support_.find_typeid_properties ( + type_id + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); TAO::PG_Object_Group * objectGroup = TAO::PG_Object_Group::create ( |