diff options
author | bala <balanatarajan@users.noreply.github.com> | 2003-04-09 20:47:36 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2003-04-09 20:47:36 +0000 |
commit | af9ffb4e5653100626f9c1f602e720d6e7fe8cab (patch) | |
tree | 390a0e38dbffcbdcc3e624cf310749249414777a | |
parent | 1ae9b9309168ed722dbf3e63aabf785786765d84 (diff) | |
download | ATCD-af9ffb4e5653100626f9c1f602e720d6e7fe8cab.tar.gz |
ChangeLogTag:Wed Apr 9 15:28:47 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 25 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_operation/thru_poa_proxy_impl_ss.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/Domain/DomainS.cpp | 4 | ||||
-rw-r--r-- | TAO/tao/PortableServer/ImR_LocatorS.cpp | 12 | ||||
-rw-r--r-- | TAO/tao/PortableServer/ImplRepoS.cpp | 28 | ||||
-rw-r--r-- | TAO/tao/PortableServer/PolicyS.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/PortableServer/ThruPOA_Object_Proxy_Impl.cpp | 8 | ||||
-rw-r--r-- | TAO/tao/RTPortableServer/RT_Collocation_Resolver.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/Stub.cpp | 20 | ||||
-rw-r--r-- | TAO/tao/Stub.h | 10 |
10 files changed, 85 insertions, 32 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 59a69323323..5c6553e88d2 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,28 @@ +Wed Apr 9 15:28:47 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu> + + * tao/Stub.h (object_key): + * tao/Stub.cpp: Added a new method object_key (). The methodology + adopted by the skeletons in the collocated cases could lead to + crashes if TAO_Stub::profile_in_use_ wasnt set. The method that + has been added should get around that problem, by always + returning a usable object key. + + * tao/Domain/DomainS.cpp: + * tao/PortableServer/ImR_LocatorS.cpp: + * tao/PortableServer/ImplRepoS.cpp: + * tao/PortableServer/PolicyS.cpp: + * tao/PortableServer/ThruPOA_Object_Proxy_Impl.cpp: + * tao/RTPortableServer/RT_Collocation_Resolver.cpp: + * orbsvcs/orbsvcs//IFRService/IFR_BaseS.cpp: + * orbsvcs/orbsvcs//IFRService/IFR_BasicS.cpp: + * orbsvcs/orbsvcs//IFRService/IFR_ComponentsS.cpp: + * orbsvcs/orbsvcs//IFRService/IFR_ExtendedS.cpp: + * orbsvcs/orbsvcs//IFRService/IFR_Service_Utils.cpp: Edited the + collocated portion of the generated code to use the above method. + + * TAO_IDL/be/be_visitor_operation/thru_poa_proxy_impl_ss.cpp: + Use the above method in TAO_Stub to access the object_key. + Wed Apr 09 14:54:03 2003 Pradeep Gore <pradeep@oomworks.com> * orbsvcs/tests/Notify/Destroy/main.cpp: diff --git a/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_proxy_impl_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_proxy_impl_ss.cpp index 45caf0730d9..8b30a1ce8c8 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_proxy_impl_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_proxy_impl_ss.cpp @@ -135,7 +135,7 @@ be_visitor_operation_thru_poa_proxy_impl_ss::visit_operation ( << ");" << be_uidt_nl << "CORBA::Object_var forward_to;" << be_nl << "servant_upcall.prepare_for_upcall (" << be_idt << be_idt_nl - << "_collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key ()," << be_nl + << "_collocated_tao_target_->_stubobj ()->object_key ()," << be_nl << "\""; // Check if we are an attribute node in disguise. diff --git a/TAO/tao/Domain/DomainS.cpp b/TAO/tao/Domain/DomainS.cpp index 9b8a6c1129c..7df5944b374 100644 --- a/TAO/tao/Domain/DomainS.cpp +++ b/TAO/tao/Domain/DomainS.cpp @@ -482,7 +482,7 @@ POA_CORBA::_TAO_DomainManager_ThruPOA_Proxy_Impl::_TAO_DomainManager_ThruPOA_Pro ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "get_domain_policy", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -1338,7 +1338,7 @@ void POA_CORBA::_TAO_ConstructionPolicy_ThruPOA_Proxy_Impl::make_domain_manager ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "make_domain_manager", forward_to.out () ACE_ENV_ARG_PARAMETER diff --git a/TAO/tao/PortableServer/ImR_LocatorS.cpp b/TAO/tao/PortableServer/ImR_LocatorS.cpp index ee72904af26..663c736f795 100644 --- a/TAO/tao/PortableServer/ImR_LocatorS.cpp +++ b/TAO/tao/PortableServer/ImR_LocatorS.cpp @@ -1368,7 +1368,7 @@ void POA_ImplementationRepository::_TAO_Locator_ThruPOA_Proxy_Impl::activate_ser ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "activate_server_in_location", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -1413,7 +1413,7 @@ void POA_ImplementationRepository::_TAO_Locator_ThruPOA_Proxy_Impl::remove_serve ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "remove_server_in_location", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -1458,7 +1458,7 @@ void POA_ImplementationRepository::_TAO_Locator_ThruPOA_Proxy_Impl::shutdown_ser ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "shutdown_server_in_location", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -1503,7 +1503,7 @@ void POA_ImplementationRepository::_TAO_Locator_ThruPOA_Proxy_Impl::server_is_sh ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "server_is_shutting_down_in_location", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -1549,7 +1549,7 @@ CORBA::ULong POA_ImplementationRepository::_TAO_Locator_ThruPOA_Proxy_Impl::regi ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "register_activator", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -1595,7 +1595,7 @@ CORBA::ULong POA_ImplementationRepository::_TAO_Locator_ThruPOA_Proxy_Impl::unre ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "unregister_activator", forward_to.out () ACE_ENV_ARG_PARAMETER diff --git a/TAO/tao/PortableServer/ImplRepoS.cpp b/TAO/tao/PortableServer/ImplRepoS.cpp index 0d3b3348336..851b6351c28 100644 --- a/TAO/tao/PortableServer/ImplRepoS.cpp +++ b/TAO/tao/PortableServer/ImplRepoS.cpp @@ -583,7 +583,7 @@ void POA_ImplementationRepository::_TAO_ServerObject_ThruPOA_Proxy_Impl::ping ( ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "ping", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -623,7 +623,7 @@ void POA_ImplementationRepository::_TAO_ServerObject_ThruPOA_Proxy_Impl::shutdow ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "shutdown", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -3056,7 +3056,7 @@ void POA_ImplementationRepository::_TAO_Administration_ThruPOA_Proxy_Impl::activ ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "activate_server", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -3102,7 +3102,7 @@ char * POA_ImplementationRepository::_TAO_Administration_ThruPOA_Proxy_Impl::act ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "activate_server_with_startup", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -3147,7 +3147,7 @@ void POA_ImplementationRepository::_TAO_Administration_ThruPOA_Proxy_Impl::regis ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "register_server", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -3191,7 +3191,7 @@ void POA_ImplementationRepository::_TAO_Administration_ThruPOA_Proxy_Impl::rereg ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "reregister_server", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -3235,7 +3235,7 @@ void POA_ImplementationRepository::_TAO_Administration_ThruPOA_Proxy_Impl::remov ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "remove_server", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -3278,7 +3278,7 @@ void POA_ImplementationRepository::_TAO_Administration_ThruPOA_Proxy_Impl::shutd ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "shutdown_server", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -3324,7 +3324,7 @@ char * POA_ImplementationRepository::_TAO_Administration_ThruPOA_Proxy_Impl::ser ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "server_is_running", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -3369,7 +3369,7 @@ void POA_ImplementationRepository::_TAO_Administration_ThruPOA_Proxy_Impl::serve ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "server_is_shutting_down", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -3413,7 +3413,7 @@ void POA_ImplementationRepository::_TAO_Administration_ThruPOA_Proxy_Impl::find ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "find", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -3458,7 +3458,7 @@ void POA_ImplementationRepository::_TAO_Administration_ThruPOA_Proxy_Impl::list ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "list", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -5859,7 +5859,7 @@ CORBA::Boolean POA_ImplementationRepository::_TAO_ServerInformationIterator_Thru ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "next_n", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -5901,7 +5901,7 @@ void POA_ImplementationRepository::_TAO_ServerInformationIterator_ThruPOA_Proxy_ ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "destroy", forward_to.out () ACE_ENV_ARG_PARAMETER diff --git a/TAO/tao/PortableServer/PolicyS.cpp b/TAO/tao/PortableServer/PolicyS.cpp index a91849bf891..e02639fbedd 100644 --- a/TAO/tao/PortableServer/PolicyS.cpp +++ b/TAO/tao/PortableServer/PolicyS.cpp @@ -742,7 +742,7 @@ CORBA::PolicyType POA_CORBA::_TAO_Policy_ThruPOA_Proxy_Impl::policy_type ( ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "policy_type", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -783,7 +783,7 @@ CORBA::PolicyType POA_CORBA::_TAO_Policy_ThruPOA_Proxy_Impl::policy_type ( ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "copy", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -823,7 +823,7 @@ void POA_CORBA::_TAO_Policy_ThruPOA_Proxy_Impl::destroy ( ); CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - _collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key (), + _collocated_tao_target_->_stubobj ()->object_key (), "destroy", forward_to.out () ACE_ENV_ARG_PARAMETER diff --git a/TAO/tao/PortableServer/ThruPOA_Object_Proxy_Impl.cpp b/TAO/tao/PortableServer/ThruPOA_Object_Proxy_Impl.cpp index 68e20fb5603..a3c2523cc53 100644 --- a/TAO/tao/PortableServer/ThruPOA_Object_Proxy_Impl.cpp +++ b/TAO/tao/PortableServer/ThruPOA_Object_Proxy_Impl.cpp @@ -32,7 +32,7 @@ TAO_ThruPOA_Object_Proxy_Impl::_is_a (const CORBA::Object_ptr target, CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - target->_stubobj ()->profile_in_use ()->object_key (), + target->_stubobj ()->object_key (), "_is_a", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -63,7 +63,7 @@ TAO_ThruPOA_Object_Proxy_Impl::_non_existent (const CORBA::Object_ptr target CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - target->_stubobj ()->profile_in_use ()->object_key (), + target->_stubobj ()->object_key (), "_non_existent", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -101,7 +101,7 @@ TAO_ThruPOA_Object_Proxy_Impl::_get_interface (const CORBA::Object_ptr target CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - target->_stubobj ()->profile_in_use ()->object_key (), + target->_stubobj ()->object_key (), "_interface", forward_to.out () ACE_ENV_ARG_PARAMETER @@ -138,7 +138,7 @@ TAO_ThruPOA_Object_Proxy_Impl::_get_component (const CORBA::Object_ptr target CORBA::Object_var forward_to; servant_upcall.prepare_for_upcall ( - target->_stubobj ()->profile_in_use ()->object_key (), + target->_stubobj ()->object_key (), "_component", forward_to.out () ACE_ENV_ARG_PARAMETER); diff --git a/TAO/tao/RTPortableServer/RT_Collocation_Resolver.cpp b/TAO/tao/RTPortableServer/RT_Collocation_Resolver.cpp index 67b3e685663..e03bfaa0c87 100644 --- a/TAO/tao/RTPortableServer/RT_Collocation_Resolver.cpp +++ b/TAO/tao/RTPortableServer/RT_Collocation_Resolver.cpp @@ -33,7 +33,7 @@ TAO_RT_Collocation_Resolver::is_collocated (CORBA::Object_ptr object // until <servant_upcall> dies. TAO_Object_Adapter::Servant_Upcall servant_upcall (orb_core); TAO_POA *poa = - servant_upcall.lookup_POA (object->_stubobj ()->profile_in_use ()->object_key () + servant_upcall.lookup_POA (object->_stubobj ()->object_key () ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); diff --git a/TAO/tao/Stub.cpp b/TAO/tao/Stub.cpp index 6cb5e4e2d38..165010be672 100644 --- a/TAO/tao/Stub.cpp +++ b/TAO/tao/Stub.cpp @@ -232,6 +232,26 @@ TAO_Stub::create_ior_info (IOP::IOR *&ior_info, } +const TAO::ObjectKey & +TAO_Stub::object_key (void) const +{ + // Return the profile in use's object key if you see one. + if (this->profile_in_use_) + return this->profile_in_use_->object_key (); + + if (this->forward_profiles_) + { + // Double-checked + ACE_Guard<ACE_Lock> obj (*this->profile_lock_ptr_); + + if (obj.locked () != 0 && this->forward_profiles_ != 0) + return this->forward_profiles_->get_profile (0)->object_key (); + } + + // If no forwarded profiles, just use the base profile + return this->base_profiles_.get_profile (0)->object_key (); +} + int TAO_Stub::get_profile_ior_info (TAO_MProfile &profiles, IOP::IOR *&ior_info diff --git a/TAO/tao/Stub.h b/TAO/tao/Stub.h index 1301d011970..7709074a34f 100644 --- a/TAO/tao/Stub.h +++ b/TAO/tao/Stub.h @@ -40,6 +40,11 @@ class TAO_Policy_Set; class TAO_Profile; +/// Forward declaration for ObjectKey +namespace TAO +{ + class ObjectKey; +} // Function pointer returning a pointer to CORBA::Exception. This is used to // describe the allocator for user-defined exceptions that are used internally // by the interpreter. @@ -181,7 +186,10 @@ public: // Manage the base (non-forwarded) profiles. /// returns a pointer to the profile_in_use object. This object /// retains ownership of this profile. - TAO_Profile *profile_in_use (void) ; + TAO_Profile *profile_in_use (void); + + /// Return the ObjectKey + const TAO::ObjectKey &object_key (void) const; /** * Copy of the profile list, user must free memory when done. |