00001 #include "orbsvcs/SSLIOP/SSLIOP_Util.h" 00002 00003 00004 ACE_RCSID (SSLIOP, 00005 SSLIOP_Util, 00006 "$Id: SSLIOP_Util.cpp 77188 2007-02-19 12:34:36Z johnnyw $") 00007 00008 00009 #include "orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h" 00010 #include "orbsvcs/SSLIOP/SSLIOP_Current.h" 00011 00012 #include "tao/ORB_Core.h" 00013 #include "tao/debug.h" 00014 00015 00016 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00017 00018 TAO::SSLIOP::Current_ptr 00019 TAO::SSLIOP::Util::current (TAO_ORB_Core *orb_core) 00020 { 00021 try 00022 { 00023 // Go straight to the object_ref_table in the ORB Core to avoid 00024 // the ORB::resolve_initial_references() mechanism's complaints 00025 // about the fact that the ORB isn't fully initialized yet 00026 // (happens on the client side). 00027 CORBA::Object_var obj = 00028 orb_core->object_ref_table ().resolve_initial_reference ( 00029 "SSLIOPCurrent"); 00030 00031 TAO::SSLIOP::Current_var tao_current = 00032 TAO::SSLIOP::Current::_narrow (obj.in ()); 00033 00034 if (CORBA::is_nil (tao_current.in ())) 00035 throw CORBA::INV_OBJREF (); 00036 00037 return tao_current._retn (); 00038 } 00039 catch (const CORBA::Exception& ex) 00040 { 00041 if (TAO_debug_level > 0) 00042 ex._tao_print_exception ( 00043 "Could not resolve \"SSLIOPCurrent\" object"); 00044 00045 return 0; 00046 } 00047 00048 return 0; 00049 } 00050 00051 TAO_END_VERSIONED_NAMESPACE_DECL