00001 #include "tao/RTCORBA/RT_Endpoint_Utils.h" 00002 #include "tao/Profile_Transport_Resolver.h" 00003 00004 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0 00005 00006 #include "tao/RTCORBA/RT_Endpoint_Selector_Factory.h" 00007 #include "tao/RTCORBA/RT_Invocation_Endpoint_Selectors.h" 00008 00009 #include "tao/RTCORBA/RT_Stub.h" 00010 00011 ACE_RCSID (RTCORBA, 00012 RT_Endpoint_Utils, 00013 "RT_Endpoint_Utils.cpp,v 1.10 2006/03/10 07:19:16 jtc Exp") 00014 00015 // **************************************************************** 00016 00017 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00018 00019 CORBA::Policy * 00020 TAO_RT_Endpoint_Utils::policy (TAO_Cached_Policy_Type type, 00021 TAO::Profile_Transport_Resolver &r 00022 ACE_ENV_ARG_DECL) 00023 { 00024 CORBA::Policy *policy = CORBA::Policy::_nil (); 00025 00026 TAO_RT_Stub *rt_stub = dynamic_cast<TAO_RT_Stub *> (r.stub ()); 00027 00028 ACE_TRY 00029 { 00030 policy = 00031 rt_stub->get_cached_policy (type 00032 ACE_ENV_ARG_PARAMETER); 00033 ACE_TRY_CHECK; 00034 } 00035 ACE_CATCH (CORBA::INV_POLICY, ex) 00036 { 00037 if (r.inconsistent_policies ()) 00038 { 00039 CORBA::PolicyList *p = r.inconsistent_policies (); 00040 p->length (1); 00041 (*p)[0u] = rt_stub->TAO_Stub::get_cached_policy (type 00042 ACE_ENV_ARG_PARAMETER); 00043 ACE_TRY_CHECK; 00044 } 00045 00046 ACE_RE_THROW; 00047 } 00048 ACE_ENDTRY; 00049 ACE_CHECK_RETURN (CORBA::Policy::_nil ()); 00050 00051 return policy; 00052 } 00053 00054 TAO_END_VERSIONED_NAMESPACE_DECL 00055 00056 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */