1 #include "tao/RTCORBA/RT_Endpoint_Utils.h"
2 #include "tao/Profile_Transport_Resolver.h"
4 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
6 #include "tao/RTCORBA/RT_Endpoint_Selector_Factory.h"
7 #include "tao/RTCORBA/RT_Invocation_Endpoint_Selectors.h"
9 #include "tao/RTCORBA/RT_Stub.h"
11 #include "tao/SystemException.h"
13 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
16 TAO_RT_Endpoint_Utils::policy (TAO_Cached_Policy_Type type
,
17 TAO::Profile_Transport_Resolver
&r
)
19 CORBA::Policy_ptr policy
= CORBA::Policy::_nil ();
21 TAO_RT_Stub
* const rt_stub
=
22 dynamic_cast<TAO_RT_Stub
*> (r
.stub ());
25 throw CORBA::INTERNAL ();
29 policy
= rt_stub
->get_cached_policy (type
);
31 catch (const ::CORBA::INV_POLICY
&)
33 if (r
.inconsistent_policies ())
35 CORBA::PolicyList
*p
= r
.inconsistent_policies ();
37 (*p
)[0u] = rt_stub
->TAO_Stub::get_cached_policy (type
);
46 TAO_END_VERSIONED_NAMESPACE_DECL
48 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */