diff options
Diffstat (limited to 'TAO/tao/ORB_Core.cpp')
-rw-r--r-- | TAO/tao/ORB_Core.cpp | 76 |
1 files changed, 29 insertions, 47 deletions
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index 407d1d89af2..510bfbad1fd 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -1612,12 +1612,16 @@ TAO_ORB_Core::create_object (TAO_Stub *stub) ++i) { TAO_ORB_Core *other_core = (*i).int_id_; - CORBA::Object_ptr x = - this->create_collocated_object (stub, - other_core, - mprofile); - if (x != 0) - return x; + + if (this->is_collocation_enabled (other_core, + mprofile)) + { + TAO_Adapter_Registry *ar = + other_core->adapter_registry (); + + return ar->create_collocated_object (stub, + mprofile); + } } } @@ -1637,6 +1641,10 @@ CORBA::Long TAO_ORB_Core::initialize_object (TAO_Stub *stub, CORBA::Object_ptr obj) { + // @@ What about forwarding. With this approach we are never forwarded + // when we use collocation! + const TAO_MProfile &mprofile = + stub->base_profiles (); { // @@ Ossama: maybe we need another lock for the table, to // reduce contention on the Static_Object_Lock below, if so @@ -1652,22 +1660,25 @@ TAO_ORB_Core::initialize_object (TAO_Stub *stub, ++i) { TAO_ORB_Core *other_core = (*i).int_id_; - CORBA::Long retval = - this->initialize_collocated_object (stub, - other_core, - obj); - if (retval != -1) - return 1; + + if (this->is_collocation_enabled (other_core, + mprofile)) + { + TAO_Adapter_Registry *ar = + other_core->adapter_registry (); + + return ar->initialize_collocated_object (stub, + obj); + } } } return 0; } -CORBA::Object_ptr -TAO_ORB_Core::create_collocated_object (TAO_Stub *stub, - TAO_ORB_Core *orb_core, - const TAO_MProfile &mprofile) +CORBA::Boolean +TAO_ORB_Core::is_collocation_enabled (TAO_ORB_Core *orb_core, + const TAO_MProfile &mp) { if (!orb_core->optimize_collocation_objects ()) return 0; @@ -1675,39 +1686,10 @@ TAO_ORB_Core::create_collocated_object (TAO_Stub *stub, if (!orb_core->use_global_collocation () && orb_core != this) return 0; - if (!orb_core->is_collocated (mprofile)) + if (!orb_core->is_collocated (mp)) return 0; - // OK, the target ORB and the mprofile match, use the Adapter - // Registry of each ORB to find the right one. - - return orb_core->adapter_registry ()->create_collocated_object (stub, - mprofile); -} - - -CORBA::Long -TAO_ORB_Core::initialize_collocated_object (TAO_Stub *stub, - TAO_ORB_Core *orb_core, - CORBA::Object_ptr obj) -{ - // @@ What about forwarding. With this approach we are never forwarded - // when we use collocation! - const TAO_MProfile &mprofile = stub->base_profiles (); - - if (!orb_core->optimize_collocation_objects ()) - return -1; - - if (!orb_core->use_global_collocation () && orb_core != this) - return -1; - - if (!orb_core->is_collocated (mprofile)) - return -1; - - // OK, the target ORB and the mprofile match, use the Adapter - // Registry of each ORB to find the right one. - return orb_core->adapter_registry ()->initialize_collocated_object (stub, - obj); + return 1; } int |