From 89acf2cfb22eed3e1fd0b624e8c7ce6a5f56dda3 Mon Sep 17 00:00:00 2001 From: wilson_d Date: Wed, 26 Nov 2003 18:28:25 +0000 Subject: ChangeLogTag: Wed Nov 26 12:22:46 2003 Dale Wilson --- TAO/ChangeLog | 16 ++++++ .../FT_ReplicationManager.cpp | 10 ++-- .../orbsvcs/CosEvent/CEC_TypedConsumerAdmin.cpp | 12 +++-- .../orbsvcs/PortableGroup/PG_Object_Group.cpp | 60 +++++++++++++--------- .../orbsvcs/PortableGroup/PG_Object_Group.h | 29 +++++++---- 5 files changed, 84 insertions(+), 43 deletions(-) diff --git a/TAO/ChangeLog b/TAO/ChangeLog index cadd3e5fdea..78d6f0e5e5c 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,19 @@ +Wed Nov 26 12:22:46 2003 Dale Wilson + + * orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp: + * orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h: + * orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp: + LInux build errors/warnings. + Feedback from code review: + accessor methods all named get* or set* + ACE::OS as necessary + Extend internals check to additional methods. + Document why PG_Object_Group::set_primary can't throw FT:PrimaryNotSet + + + * orbsvcs/orbsvcs/CosEvent/CEC_TypedConsumerAdmin.cpp: + Fix Solaris build problem -- redundant template instantiation. + Wed Nov 26 10:38:01 2003 Dale Wilson * orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp: diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp index e8538bc17fd..453f28c4a71 100644 --- a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp +++ b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp @@ -719,7 +719,7 @@ TAO::FT_ReplicationManager::add_member ( the_location, member ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (result); + ACE_CHECK_RETURN (result._retn ()); /////////////////////// // Now we do it again using @@ -743,7 +743,7 @@ TAO::FT_ReplicationManager::add_member ( ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::add_member to unknown group\n") )); } - ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), result); + ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), result._retn ()); } METHOD_RETURN (TAO::FT_ReplicationManager::add_member) result._retn (); @@ -765,7 +765,7 @@ TAO::FT_ReplicationManager::remove_member ( if (this->object_group_map_.find_group (object_group, group)) { group->remove_member(the_location ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (result); + ACE_CHECK_RETURN (result._retn ()); result = group->reference (); // @@ warning: if the remove_member call below is unsuccessful @@ -780,9 +780,9 @@ TAO::FT_ReplicationManager::remove_member ( } else { - ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), result); + ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), result._retn ()); } - return result; + return result._retn (); } PortableGroup::Locations * diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedConsumerAdmin.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedConsumerAdmin.cpp index 721ca9fb449..aae85a3def2 100644 --- a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedConsumerAdmin.cpp +++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedConsumerAdmin.cpp @@ -131,16 +131,20 @@ TAO_CEC_Propagate_Typed_Event::work (TAO_CEC_ProxyPushSupplier *supplier // **************************************************************** +// Note the following are explicitly instantiated in CEC_ConsumerAdmin +// instantiating them here results in duplicate symbols from Solaris build: +// CC: Forte Developer 7 C++ 5.4 2002/03/09 +// template class TAO_ESF_Shutdown_Proxy; +// template class TAO_ESF_Worker; +// #pragma instantiate TAO_ESF_Shutdown_Proxy +// #pragma instantiate TAO_ESF_Worker + #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class TAO_ESF_Proxy_Admin; -template class TAO_ESF_Shutdown_Proxy; -template class TAO_ESF_Worker; #elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) #pragma instantiate TAO_ESF_Proxy_Admin -#pragma instantiate TAO_ESF_Shutdown_Proxy -#pragma instantiate TAO_ESF_Worker #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp index 499216c503c..66198c0adda 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp @@ -149,19 +149,23 @@ TAO::PG_Object_Group::~PG_Object_Group () } -void dump_ior (const char * base, const char * ext, unsigned long version, const char * iogr) +///////////////////// +// q&d debug function +static void dump_ior (const char * base, const char * ext, unsigned long version, const char * iogr) { char filename[1000]; - sprintf(filename, "%s_%lu.%s", base, version, ext ); + ACE_OS::sprintf(filename, "%s_%lu.%s", base, version, ext ); - FILE * iorfile = fopen(filename, "w"); - fwrite (iogr, 1, strlen(iogr), iorfile); - fclose (iorfile); + FILE * iorfile = ACE_OS::fopen(filename, "w"); + ACE_OS::fwrite (iogr, 1, ACE_OS::strlen(iogr), iorfile); + ACE_OS::fclose (iorfile); } PortableGroup::ObjectGroup_ptr TAO::PG_Object_Group::reference()const { + // const cast to simulate mutable + InternalGuard guard(ACE_const_cast (TAO::PG_Object_Group *, this)->internals_); return PortableGroup::ObjectGroup::_duplicate (this->reference_); } @@ -171,20 +175,20 @@ void TAO::PG_Object_Group::set_membership_style (PortableGroup::MembershipStyleV this->membership_style_ = style; } -PortableGroup::MembershipStyleValue TAO::PG_Object_Group::membership_style () const +PortableGroup::MembershipStyleValue TAO::PG_Object_Group::get_membership_style () const { // const cast to simulate mutable InternalGuard guard(ACE_const_cast (TAO::PG_Object_Group *, this)->internals_); return this->membership_style_; } -void TAO::PG_Object_Group::initial_number_members (PortableGroup::InitialNumberMembersValue count) +void TAO::PG_Object_Group::set_initial_number_members (PortableGroup::InitialNumberMembersValue count) { InternalGuard guard(this->internals_); this->initial_number_members_ = count; } -PortableGroup::InitialNumberMembersValue TAO::PG_Object_Group::initial_number_members () const +PortableGroup::InitialNumberMembersValue TAO::PG_Object_Group::get_initial_number_members () const { // const cast to simulate mutable InternalGuard guard(ACE_const_cast (TAO::PG_Object_Group *, this)->internals_); @@ -197,8 +201,10 @@ void TAO::PG_Object_Group::set_minimum_number_members (PortableGroup::MinimumNum this->minimum_number_members_ = count; } -PortableGroup::MinimumNumberMembersValue TAO::PG_Object_Group::minimum_number_members ()const +PortableGroup::MinimumNumberMembersValue TAO::PG_Object_Group::get_minimum_number_members ()const { + // const cast to simulate mutable + InternalGuard guard(ACE_const_cast (TAO::PG_Object_Group *, this)->internals_); return this->minimum_number_members_; } @@ -209,7 +215,7 @@ void TAO::PG_Object_Group::set_group_specific_factories (const PortableGroup::Fa } -void TAO::PG_Object_Group::group_specific_factories (PortableGroup::FactoryInfos & result) const +void TAO::PG_Object_Group::get_group_specific_factories (PortableGroup::FactoryInfos & result) const { // const cast to simulate mutable InternalGuard guard(ACE_const_cast (TAO::PG_Object_Group *, this)->internals_); @@ -295,9 +301,9 @@ void TAO::PG_Object_Group::add_member ( } this->reference_ = new_reference; // note var-to-var assignment does a duplicate - if (increment_version ()) + if (this->increment_version ()) { - distribute_iogr (ACE_ENV_SINGLE_ARG_PARAMETER); + this->distribute_iogr (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; } else @@ -357,26 +363,36 @@ int TAO::PG_Object_Group::set_primary_member ( ACE_TEXT ("%T %n (%P|%t) - Can't set primary in IOGR .\n") )); } +//@@: ACE_THROW (FT::PrimaryNotSet()); + result = 0; + } + + if (result && this->increment_version()) + { + this->distribute_iogr (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); } - if (result ) + else { - if (increment_version()) + if (TAO_debug_level > 3) { - distribute_iogr (); - ACE_CHECK_RETURN (0); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("TAO-PG (%P|%t) - set_primary_location throwing PrimaryNotSet because increment version failed.\n") + )); } +//@@: ACE_THROW (FT::PrimaryNotSet()); + result = 0; } } else { if (TAO_debug_level > 3) { - ACE_DEBUG ((LM_DEBUG, - "TAO-PG (%P|%t) - set_primary_location throwing MemberNotFound.\n" + ACE_TEXT ("TAO-PG (%P|%t) - set_primary_location throwing MemberNotFound.\n") )); } - ACE_THROW_RETURN (PortableGroup::MemberNotFound(), 0); + ACE_THROW (PortableGroup::MemberNotFound()); } return result; } @@ -410,9 +426,9 @@ void TAO::PG_Object_Group::remove_member ( this->primary_location_.length(0); } - if (increment_version ()) + if (this->increment_version ()) { - distribute_iogr (ACE_ENV_SINGLE_ARG_PARAMETER); + this->distribute_iogr (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; } @@ -592,8 +608,6 @@ void TAO::PG_Object_Group::dump_membership (TAO_IOP::TAO_IOR_Manipulation_ptr io #endif // debug code - - #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Hash_Map_Manager_Ex < diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h index 11b9b1a0613..0169467384c 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h @@ -134,22 +134,22 @@ namespace TAO public: /// Set object group id - void set_oid (PortableGroup::ObjectGroupId oid); - /// Set type ID + void set_object_group_id (PortableGroup::ObjectGroupId oid); + /// Set type ID void set_typeid (PortableGroup::TypeId type_id); /// return a duplicated reference to this group (IOGR) PortableGroup::ObjectGroup_ptr reference()const; void set_membership_style (PortableGroup::MembershipStyleValue style); - PortableGroup::MembershipStyleValue membership_style () const; + PortableGroup::MembershipStyleValue get_membership_style () const; - void initial_number_members (PortableGroup::InitialNumberMembersValue count); - PortableGroup::InitialNumberMembersValue initial_number_members () const; + void set_initial_number_members (PortableGroup::InitialNumberMembersValue count); + PortableGroup::InitialNumberMembersValue get_initial_number_members () const; void set_minimum_number_members (PortableGroup::MinimumNumberMembersValue count); - PortableGroup::MinimumNumberMembersValue minimum_number_members ()const; + PortableGroup::MinimumNumberMembersValue get_minimum_number_members ()const; void set_group_specific_factories (const PortableGroup::FactoryInfos & infos); @@ -157,7 +157,7 @@ namespace TAO * Note the caller receives a copy of the factoryinfos in the result argument. * inefficient, but thread safe. */ - void group_specific_factories (PortableGroup::FactoryInfos & result) const; + void get_group_specific_factories (PortableGroup::FactoryInfos & result) const; /** * get location of primary member @@ -183,9 +183,8 @@ namespace TAO /** * Add a new member to the group. - * @param reference a group that the ObjectManager has already operated upon. * @param the_location the location for the new member - * @param member_ior_string the IOR for the new memeber (expressed as a string.) + * @param member the member to be added */ void add_member ( const PortableGroup::Location & the_location, @@ -195,6 +194,14 @@ namespace TAO PortableGroup::ObjectNotAdded)); + + /** + * set the replica at the given location to be primary. + * Note: This should return void and throw FT::PrimaryNotSet + * but to avoid dependancies between PortableGroup and FaultTolerance + * it returns a boolean result. A false return means caller should + * throw FT::PrimaryNot_Set. + */ int set_primary_member ( TAO_IOP::TAO_IOR_Property * prop, const PortableGroup::Location & the_location @@ -233,9 +240,9 @@ namespace TAO /** * Set the poa to be used to manage object groups * Note: this is NOT the poa used to create object group members. - * @param poa a reference to a var to avoid reference count confusion. + * @param poa the poa to use */ - void set_poa (PortableServer::POA_var & poa); + static void set_poa (PortableServer::POA_ptr poa); /////////////// // Static Data -- cgit v1.2.1