diff options
Diffstat (limited to 'TAO/tao/ORB.cpp')
-rw-r--r-- | TAO/tao/ORB.cpp | 63 |
1 files changed, 22 insertions, 41 deletions
diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index a4554a2ed2b..e26a0810018 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -251,7 +251,7 @@ CORBA::ORB::work_pending (ACE_Time_Value &tv ACE_ENV_ARG_DECL) this->check_shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (0); - const int result = this->orb_core_->reactor ()->work_pending (tv); + int const result = this->orb_core_->reactor ()->work_pending (tv); if (result == 0 || (result == -1 && errno == ETIME)) return 0; @@ -1894,7 +1894,7 @@ CORBA::ORB::url_ior_string_to_object (const char* str this->orb_core_->connector_registry (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (0); - int retv = + int const retv = conn_reg->make_mprofile (str, mprofile ACE_ENV_ARG_PARAMETER); @@ -1953,40 +1953,26 @@ CORBA::ORB::register_value_factory (const char *repository_id, CORBA::ValueFactory factory ACE_ENV_ARG_DECL) { - // %! guard, and ACE_Null_Mutex in the map - // do _add_ref here not in map->rebind + TAO_Valuetype_Adapter *vta = this->orb_core ()->valuetype_adapter (); - if (this->orb_core ()->valuetype_adapter () == 0) + if (vta) { + int const result = vta->vf_map_rebind (repository_id, + factory); - this->orb_core ()->valuetype_adapter () = - ACE_Dynamic_Service<TAO_Valuetype_Adapter>::instance ( - TAO_ORB_Core::valuetype_adapter_name () - ); + if (result == 0) // No previous factory found + { + return 0; + } - if (this->orb_core ()->valuetype_adapter () == 0) + if (result == -1) { - ACE_THROW_RETURN (CORBA::INTERNAL (), + // Error on bind. + ACE_THROW_RETURN (CORBA::MARSHAL (), 0); } } - int result = - this->orb_core ()->valuetype_adapter ()->vf_map_rebind (repository_id, - factory); - - if (result == 0) // No previous factory found - { - return 0; - } - - if (result == -1) - { - // Error on bind. - ACE_THROW_RETURN (CORBA::MARSHAL (), - 0); - } - return factory; // previous factory was found } @@ -1994,10 +1980,12 @@ void CORBA::ORB::unregister_value_factory (const char *repository_id ACE_ENV_ARG_DECL_NOT_USED) { - if (this->orb_core ()->valuetype_adapter ()) + TAO_Valuetype_Adapter *vta = this->orb_core ()->valuetype_adapter (); + + if (vta) { // Dont care whther it was successful or not! - (void) this->orb_core ()->valuetype_adapter ()->vf_map_unbind (repository_id); + (void) vta->vf_map_unbind (repository_id); } } @@ -2005,21 +1993,14 @@ CORBA::ValueFactory CORBA::ORB::lookup_value_factory (const char *repository_id ACE_ENV_ARG_DECL) { - if (this->orb_core ()->valuetype_adapter () == 0) - { - this->orb_core ()->valuetype_adapter () = - ACE_Dynamic_Service<TAO_Valuetype_Adapter>::instance ( - TAO_ORB_Core::valuetype_adapter_name () - ); + TAO_Valuetype_Adapter *vta = this->orb_core ()->valuetype_adapter (); - if (this->orb_core ()->valuetype_adapter () == 0) - { - ACE_THROW_RETURN (CORBA::INTERNAL (), - 0); - } + if (vta) + { + return vta->vf_map_find (repository_id); } - return this->orb_core ()->valuetype_adapter ()->vf_map_find (repository_id); + return 0; } TAO_END_VERSIONED_NAMESPACE_DECL |