diff options
Diffstat (limited to 'TAO/orbsvcs/ImplRepo_Service/ImplRepo_i.cpp')
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/ImplRepo_i.cpp | 52 |
1 files changed, 38 insertions, 14 deletions
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImplRepo_i.cpp b/TAO/orbsvcs/ImplRepo_Service/ImplRepo_i.cpp index 5b3607b1a2a..76257cd60ff 100644 --- a/TAO/orbsvcs/ImplRepo_Service/ImplRepo_i.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/ImplRepo_i.cpp @@ -23,7 +23,7 @@ CORBA::Object_ptr ImplRepo_i::activate_object (CORBA::Object_ptr obj, CORBA::Environment &ACE_TRY_ENV) { - /* Implementation_Repository::INET_Addr *new_addr; */ + Implementation_Repository::INET_Addr *new_addr; TAO_Stub *new_stub_obj = 0; if (OPTIONS::instance()->debug () >= 1) @@ -34,7 +34,7 @@ ImplRepo_i::activate_object (CORBA::Object_ptr obj, ACE_TRY { // @@ Where to get the poa name from? - /* new_addr = */ this->activate_server (0, ACE_TRY_ENV); + new_addr = this->activate_server (0, ACE_TRY_ENV); ACE_TRY_CHECK; // @@ Use auto_ptr<> to avoid memory leaks! @@ -657,32 +657,51 @@ void IR_Forwarder::invoke (CORBA::ServerRequest_ptr /* request */, CORBA::Environment &ACE_TRY_ENV) { - TAO_ORB_Core *orb_core = this->orb_var_->orb_core (); - TAO_POA_Current_Impl *poa_current_impl = orb_core->poa_current ().implementation (); + // Get the POA Current object reference + CORBA::Object_var obj = this->orb_var_->resolve_initial_references ("POACurrent"); + + TAO_ORB_Core *orb_core = TAO_ORB_Core_instance (); + TAO_POA_Current *poa_current = orb_core->poa_current (); + + if (ACE_TRY_ENV.exception () != 0) + { + ACE_TRY_ENV.print_exception ("PortableServer::Current::_narrow"); + return; + } // The servant determines the key associated with the database entry // represented by self - PortableServer::ObjectId_var oid = poa_current_impl->get_object_id (ACE_TRY_ENV); - ACE_CHECK; + PortableServer::ObjectId_var oid = poa_current->get_object_id (ACE_TRY_ENV); + if (ACE_TRY_ENV.exception () != 0) + return; // Now convert the id into a string CORBA::String_var key = PortableServer::ObjectId_to_string (oid.in ()); - PortableServer::POA_ptr poa = poa_current_impl->get_POA (ACE_TRY_ENV); - ACE_CHECK; + PortableServer::POA_ptr poa = poa_current->get_POA (ACE_TRY_ENV); + if (ACE_TRY_ENV.exception () != 0) + return; // Now FORWARD!!! Implementation_Repository::INET_Addr *new_addr = 0; - new_addr = this->ir_impl_->activate_server (poa->the_name (), - ACE_TRY_ENV); - ACE_CHECK; + + ACE_TRY + { + new_addr = this->ir_impl_->activate_server (poa->the_name (), + ACE_TRY_ENV); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_RETHROW; + } + ACE_ENDTRY; CORBA_Object_ptr forward_object = - this->orb_var_->key_to_object (poa_current_impl->object_key (), + this->orb_var_->key_to_object (poa_current->object_key (), 0, ACE_TRY_ENV); - ACE_CHECK; TAO_Stub *stub_obj = ACE_dynamic_cast (TAO_Stub *, forward_object->_stubobj ()); @@ -694,8 +713,13 @@ IR_Forwarder::invoke (CORBA::ServerRequest_ptr /* request */, iiop_pfile->port (new_addr->port_); iiop_pfile->host (new_addr->host_); +// if (TAO_debug_level > 0) +// ACE_DEBUG ((LM_DEBUG, +// "The forward_to is <%s>\n", +// this->orb_var_->object_to_string (forward_object, ACE_TRY_ENV))); + if (!CORBA::is_nil (forward_object)) - ACE_THROW (PortableServer::ForwardRequest (forward_object)); + ACE_TRY_ENV.exception (new PortableServer::ForwardRequest (forward_object)); else ACE_ERROR ((LM_ERROR, "Error: Forward_to reference is nil.\n")); |