00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file RT_Stub.h 00006 * 00007 * $Id: RT_Stub.h 82354 2008-07-22 11:34:18Z johnnyw $ 00008 * 00009 * This file contains the declaration for the RTCORBA Stub. 00010 * 00011 * 00012 * @author Angelo Corsaro <corsaro@cs.wustl.edu> 00013 * @author Frank Hunleth <fhunleth@cs.wustl.edu> 00014 */ 00015 //============================================================================= 00016 00017 #ifndef TAO_RT_STUB_H_ 00018 #define TAO_RT_STUB_H_ 00019 00020 #include /**/ "ace/pre.h" 00021 00022 #include "tao/orbconf.h" 00023 00024 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0 00025 00026 #include "tao/RTCORBA/rtcorba_export.h" 00027 00028 #include "tao/Stub.h" 00029 00030 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00031 # pragma once 00032 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00033 00034 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00035 00036 // Forward references. 00037 class TAO_PriorityModelPolicy; 00038 class TAO_PriorityBandedConnectionPolicy; 00039 class TAO_ClientProtocolPolicy; 00040 class TAO_PrivateConnectionPolicy; 00041 00042 /** 00043 * @class TAO_RT_Stub 00044 * 00045 * This class represent a stub with extended functionality, which are needed 00046 * for RTCORBA. 00047 */ 00048 class TAO_RTCORBA_Export TAO_RT_Stub : public TAO_Stub 00049 { 00050 public: 00051 00052 TAO_RT_Stub (const char *repository_id, 00053 const TAO_MProfile &profiles, 00054 TAO_ORB_Core *orb_core); 00055 00056 virtual ~TAO_RT_Stub (void); 00057 00058 00059 #if (TAO_HAS_CORBA_MESSAGING == 1) 00060 00061 /** 00062 * Returns the effective policy if @a type is a known client-exposed 00063 * policy type. Returns the effective override for all other policy 00064 * types. 00065 */ 00066 CORBA::Policy_ptr get_policy (CORBA::PolicyType type); 00067 00068 CORBA::Policy_ptr get_cached_policy (TAO_Cached_Policy_Type type); 00069 00070 TAO_Stub* set_policy_overrides (const CORBA::PolicyList & policies, 00071 CORBA::SetOverrideType set_add); 00072 00073 #endif /* TAO_HAS_CORBA_MESSAGING */ 00074 00075 private: 00076 00077 /// Helper method used to parse the policies. 00078 void parse_policies (void); 00079 00080 void exposed_priority_model (CORBA::Policy_ptr policy); 00081 00082 void exposed_priority_banded_connection (CORBA::Policy_ptr policy); 00083 00084 void exposed_client_protocol (CORBA::Policy_ptr policy); 00085 00086 /// Returns the CORBA::Policy (which will be narrowed to be 00087 /// used as RTCORBA::PriorityModelPolicy) exported 00088 /// in object's IOR. 00089 CORBA::Policy_ptr exposed_priority_model (void); 00090 00091 /// Returns the CORBA::Policy (which will be narrowed and used 00092 /// as RTCORBA::PriorityBandedConnectionPolicy) exported 00093 /// in object's IOR. 00094 CORBA::Policy_ptr exposed_priority_banded_connection (void); 00095 00096 /// Returns the CORBA::Policy (which will be narrowed and used 00097 /// as RTCORBA::ClientProtocolPolicy) exported 00098 /// in object's IOR. 00099 CORBA::Policy_ptr exposed_client_protocol (void); 00100 00101 // = Methods for obtaining effective policies. 00102 // 00103 // Effective policy is the one that would be used if a request 00104 // were made. The policy is determined by obtaining the effective 00105 // override for a given policy type, and then reconciling it with 00106 // the policy value exported in the Object's IOR. 00107 00108 CORBA::Policy_ptr effective_priority_banded_connection (void); 00109 CORBA::Policy_ptr effective_client_protocol (void); 00110 00111 // The following attribute are used to cache 00112 // the different kind of policies and avoid to 00113 // parse the MProfile's policy list each time we 00114 // are asked about a given policy. 00115 00116 CORBA::Policy_var priority_model_policy_; 00117 00118 CORBA::Policy_var priority_banded_connection_policy_; 00119 00120 CORBA::Policy_var client_protocol_policy_; 00121 00122 bool are_policies_parsed_; 00123 00124 private: 00125 // = Disallow copying and assignment. 00126 TAO_RT_Stub (const TAO_RT_Stub &); 00127 TAO_RT_Stub &operator = (const TAO_RT_Stub &); 00128 00129 }; 00130 00131 TAO_END_VERSIONED_NAMESPACE_DECL 00132 00133 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */ 00134 00135 #include /**/ "ace/post.h" 00136 00137 #endif /* TAO_RT_STUB_FACTORY_H_ */