RT_Endpoint_Utils.cpp

Go to the documentation of this file.
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 #include "tao/SystemException.h"
00012 
00013 ACE_RCSID (RTCORBA,
00014            RT_Endpoint_Utils,
00015            "$Id: RT_Endpoint_Utils.cpp 77409 2007-02-26 23:48:49Z ossama $")
00016 
00017 // ****************************************************************
00018 
00019 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00020 
00021 CORBA::Policy *
00022 TAO_RT_Endpoint_Utils::policy (TAO_Cached_Policy_Type type,
00023                                TAO::Profile_Transport_Resolver &r)
00024 {
00025   CORBA::Policy *policy = CORBA::Policy::_nil ();
00026 
00027   TAO_RT_Stub * const rt_stub =
00028     dynamic_cast<TAO_RT_Stub *> (r.stub ());
00029 
00030   if (!rt_stub)
00031     throw CORBA::INTERNAL ();
00032 
00033   try
00034     {
00035       policy =
00036         rt_stub->get_cached_policy (type);
00037     }
00038   catch (const ::CORBA::INV_POLICY&)
00039     {
00040       if (r.inconsistent_policies ())
00041         {
00042           CORBA::PolicyList *p = r.inconsistent_policies ();
00043           p->length (1);
00044           (*p)[0u] = rt_stub->TAO_Stub::get_cached_policy (type);
00045         }
00046 
00047       throw;
00048     }
00049 
00050   return policy;
00051 }
00052 
00053 TAO_END_VERSIONED_NAMESPACE_DECL
00054 
00055 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */

Generated on Tue Feb 2 17:42:49 2010 for TAO_RTCORBA by  doxygen 1.4.7