summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/ImplRepo_Service/ImplRepo_i.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/ImplRepo_Service/ImplRepo_i.cpp')
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/ImplRepo_i.cpp64
1 files changed, 46 insertions, 18 deletions
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImplRepo_i.cpp b/TAO/orbsvcs/ImplRepo_Service/ImplRepo_i.cpp
index 5b3607b1a2a..ac2f643d464 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!
@@ -43,7 +43,11 @@ ImplRepo_i::activate_object (CORBA::Object_ptr obj,
ACE_dynamic_cast (TAO_IIOP_Profile *,
stub_obj->profile_in_use ());
- TAO_MProfile mp(1);
+ TAO_MProfile *mp;
+ ACE_NEW_THROW_EX (mp,
+ TAO_MProfile (1),
+ CORBA::NO_MEMORY (CORBA::COMPLETED_MAYBE));
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
TAO_Profile *new_pfile;
// @@ Would new_addr->host_ be different from object_addr()?
@@ -52,8 +56,8 @@ ImplRepo_i::activate_object (CORBA::Object_ptr obj,
TAO_IIOP_Profile (iiop_pfile->object_addr (),
iiop_pfile->object_key ()),
CORBA::Object::_nil ());
-
- mp.give_profile (new_pfile);
+
+ mp->give_profile (new_pfile);
// create new obj, pfile will be copied!
new_stub_obj = new TAO_Stub (stub_obj->type_id,
@@ -346,7 +350,7 @@ ImplRepo_i::server_is_running (const char *server,
ACE_NEW_RETURN (rec.host, ASYS_TCHAR[ACE_OS::strlen (addr.host_.in ()) + 1], 0);
ACE_OS::strcpy (rec.host, addr.host_.in ());
rec.port = addr.port_;
-
+
ASYS_TCHAR *ping_ior = this->orb_manager_.orb ()->object_to_string (ping, ACE_TRY_ENV);
ACE_CHECK_RETURN (0);
@@ -657,32 +661,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 +717,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"));