INS_Locator Class Reference

Implementation Repository INS Locator class. More...

#include <INS_Locator.h>

Inheritance diagram for INS_Locator:

Inheritance graph
[legend]
Collaboration diagram for INS_Locator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 INS_Locator (ImR_Locator_i &loc)
char * locate (const char *object_key)
 Locate the appropriate IOR.


Private Attributes

ImR_Locator_iimr_locator_

Detailed Description

Implementation Repository INS Locator class.

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.


Constructor & Destructor Documentation

INS_Locator::INS_Locator ImR_Locator_i loc  ) 
 

Definition at line 17 of file INS_Locator.cpp.

00018 : imr_locator_ (loc)
00019 {
00020 }


Member Function Documentation

char * INS_Locator::locate const char *  object_key  ) 
 

Locate the appropriate IOR.

Definition at line 23 of file INS_Locator.cpp.

References ACE_ASSERT, ACE_CString, ACE_DEBUG, ImR_Locator_i::activate_server_by_object(), ImR_Locator_i::debug(), imr_locator_, LM_DEBUG, ssize_t, CORBA::string_dup(), and TAO_IMPLREPO_MINOR_CODE.

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 }


Member Data Documentation

ImR_Locator_i& INS_Locator::imr_locator_ [private]
 

Definition at line 48 of file INS_Locator.h.

Referenced by locate().


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 15:55:56 2008 for TAO_Implementation_Repository by doxygen 1.3.6