00001 #include "orbsvcs/SSLIOP/SSLIOP_Util.h" 00002 00003 00004 ACE_RCSID (SSLIOP, 00005 SSLIOP_Util, 00006 "SSLIOP_Util.cpp,v 1.10 2006/03/14 06:14:35 jtc Exp") 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 ( 00020 TAO_ORB_Core *orb_core) 00021 { 00022 ACE_DECLARE_NEW_CORBA_ENV; 00023 ACE_TRY 00024 { 00025 // Go straight to the object_ref_table in the ORB Core to avoid 00026 // the ORB::resolve_initial_references() mechanism's complaints 00027 // about the fact that the ORB isn't fully initialized yet 00028 // (happens on the client side). 00029 CORBA::Object_var obj = 00030 orb_core->object_ref_table ().resolve_initial_reference ( 00031 "SSLIOPCurrent"); 00032 00033 TAO::SSLIOP::Current_var tao_current = 00034 TAO::SSLIOP::Current::_narrow (obj.in () 00035 ACE_ENV_ARG_PARAMETER); 00036 ACE_TRY_CHECK; 00037 00038 if (CORBA::is_nil (tao_current.in ())) 00039 ACE_TRY_THROW (CORBA::INV_OBJREF ()); 00040 00041 return tao_current._retn (); 00042 } 00043 ACE_CATCHANY 00044 { 00045 if (TAO_debug_level > 0) 00046 ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, 00047 "Could not resolve " 00048 "\"SSLIOPCurrent\" object"); 00049 00050 return 0; 00051 } 00052 ACE_ENDTRY; 00053 ACE_CHECK_RETURN (0); 00054 00055 return 0; 00056 } 00057 00058 TAO_END_VERSIONED_NAMESPACE_DECL