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) throw (CORBA::SystemException, IORTable::NotFound)
 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  )  throw (CORBA::SystemException, IORTable::NotFound) [virtual]
 

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 }


Member Data Documentation

ImR_Locator_i& INS_Locator::imr_locator_ [private]
 

Definition at line 49 of file INS_Locator.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 13:37:19 2006 for TAO_Implementation_Repository by doxygen 1.3.6