00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "INS_Locator.h"
00014 #include "ImR_Locator_i.h"
00015 #include "tao/ORB_Constants.h"
00016
00017 INS_Locator::INS_Locator (ImR_Locator_i& loc)
00018 : imr_locator_ (loc)
00019 {
00020 }
00021
00022 char *
00023 INS_Locator::locate (const char* object_key)
00024 {
00025 ACE_ASSERT (object_key != 0);
00026 try
00027 {
00028 ACE_CString key (object_key);
00029 ssize_t poaidx = key.find ('/');
00030 if (poaidx >= 0)
00031 {
00032 key = key.substring (0, poaidx);
00033 }
00034
00035 if (imr_locator_.debug () > 1)
00036 ACE_DEBUG ((LM_DEBUG, "ImR: Activating server <%s>.\n", key.c_str ()));
00037
00038 CORBA::String_var located =
00039 this->imr_locator_.activate_server_by_object (key.c_str ());
00040
00041 ACE_CString tmp = located.in ();
00042 tmp += object_key;
00043
00044 if (imr_locator_.debug () > 0)
00045 ACE_DEBUG ((LM_DEBUG, "ImR: Forwarding invocation on <%s> to <%s>\n", key.c_str (), tmp.c_str()));
00046
00047 return CORBA::string_dup (tmp.c_str ());
00048 }
00049 catch (const ImplementationRepository::CannotActivate&)
00050 {
00051 throw CORBA::TRANSIENT (
00052 CORBA::SystemException::_tao_minor_code (
00053 TAO_IMPLREPO_MINOR_CODE,
00054 0),
00055 CORBA::COMPLETED_NO);
00056 }
00057 catch (const ImplementationRepository::NotFound&)
00058 {
00059 throw CORBA::TRANSIENT (
00060 CORBA::SystemException::_tao_minor_code (
00061 TAO_IMPLREPO_MINOR_CODE,
00062 0),
00063 CORBA::COMPLETED_NO);
00064 }
00065 }