#include <INS_Locator.h>
Inheritance diagram for INS_Locator:
Public Member Functions | |
INS_Locator (ImR_Locator_i &loc) | |
char * | locate (const char *object_key) throw (CORBA::SystemException, IORTable::NotFound) |
Locate the appropriate IOR. | |
Private Attributes | |
ImR_Locator_i & | imr_locator_ |
This class provides a callback for the IORTable to call when it needs to dynamically receive a IOR to forward in response to an INS request.
Definition at line 37 of file INS_Locator.h.
|
Definition at line 17 of file INS_Locator.cpp.
00018 : imr_locator_ (loc) 00019 { 00020 } |
|
Locate the appropriate IOR.
Implements IORTable::Locator. Definition at line 23 of file INS_Locator.cpp. References ACE_ASSERT, ACE_CATCH, ACE_CString, ACE_DEBUG, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_TRY, ACE_TRY_CHECK, ACE_TRY_THROW, LM_DEBUG, ssize_t, CORBA::string_dup(), and TAO_IMPLREPO_MINOR_CODE.
00025 { 00026 ACE_ASSERT (object_key != 0); 00027 ACE_TRY 00028 { 00029 ACE_CString key (object_key); 00030 ssize_t poaidx = key.find ('/'); 00031 if (poaidx >= 0) 00032 { 00033 key = key.substring (0, poaidx); 00034 } 00035 00036 if (imr_locator_.debug () > 1) 00037 ACE_DEBUG ((LM_DEBUG, "ImR: Activating server <%s>.\n", key.c_str ())); 00038 00039 CORBA::String_var located = 00040 this->imr_locator_.activate_server_by_object (key.c_str () ACE_ENV_ARG_PARAMETER); 00041 ACE_TRY_CHECK; 00042 00043 ACE_CString tmp = located.in (); 00044 tmp += object_key; 00045 00046 if (imr_locator_.debug () > 0) 00047 ACE_DEBUG ((LM_DEBUG, "ImR: Forwarding invocation on <%s> to <%s>\n", key.c_str (), tmp.c_str())); 00048 00049 return CORBA::string_dup (tmp.c_str ()); 00050 } 00051 ACE_CATCH (ImplementationRepository::CannotActivate, ex) 00052 { 00053 ACE_TRY_THROW (CORBA::TRANSIENT ( 00054 CORBA::SystemException::_tao_minor_code (TAO_IMPLREPO_MINOR_CODE, 0), 00055 CORBA::COMPLETED_NO)); 00056 } 00057 ACE_CATCH (ImplementationRepository::NotFound, ex) 00058 { 00059 ACE_TRY_THROW (CORBA::TRANSIENT ( 00060 CORBA::SystemException::_tao_minor_code (TAO_IMPLREPO_MINOR_CODE, 0), 00061 CORBA::COMPLETED_NO)); 00062 } 00063 ACE_ENDTRY; 00064 } |
|
Definition at line 49 of file INS_Locator.h. |