00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file RT_Stub.h 00006 * 00007 * RT_Stub.h,v 1.13 2006/03/10 07:19:16 jtc Exp 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 <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 ACE_ENV_ARG_DECL); 00068 00069 CORBA::Policy_ptr get_cached_policy (TAO_Cached_Policy_Type type 00070 ACE_ENV_ARG_DECL); 00071 00072 TAO_Stub* set_policy_overrides (const CORBA::PolicyList & policies, 00073 CORBA::SetOverrideType set_add 00074 ACE_ENV_ARG_DECL); 00075 00076 #endif /* TAO_HAS_CORBA_MESSAGING */ 00077 00078 private: 00079 00080 /// Helper method used to parse the policies. 00081 void parse_policies (ACE_ENV_SINGLE_ARG_DECL); 00082 00083 void exposed_priority_model (CORBA::Policy_ptr policy); 00084 00085 void exposed_priority_banded_connection (CORBA::Policy_ptr policy); 00086 00087 void exposed_client_protocol (CORBA::Policy_ptr policy); 00088 00089 /// Returns the CORBA::Policy (which will be narrowed to be 00090 /// used as RTCORBA::PriorityModelPolicy) exported 00091 /// in object's IOR. 00092 CORBA::Policy_ptr exposed_priority_model (ACE_ENV_SINGLE_ARG_DECL); 00093 00094 /// Returns the CORBA::Policy (which will be narrowed and used 00095 /// as RTCORBA::PriorityBandedConnectionPolicy) exported 00096 /// in object's IOR. 00097 CORBA::Policy_ptr exposed_priority_banded_connection (ACE_ENV_SINGLE_ARG_DECL); 00098 00099 /// Returns the CORBA::Policy (which will be narrowed and used 00100 /// as RTCORBA::ClientProtocolPolicy) exported 00101 /// in object's IOR. 00102 CORBA::Policy_ptr exposed_client_protocol (ACE_ENV_SINGLE_ARG_DECL); 00103 00104 // = Methods for obtaining effective policies. 00105 // 00106 // Effective policy is the one that would be used if a request 00107 // were made. The policy is determined by obtaining the effective 00108 // override for a given policy type, and then reconciling it with 00109 // the policy value exported in the Object's IOR. 00110 00111 CORBA::Policy *effective_priority_banded_connection (ACE_ENV_SINGLE_ARG_DECL); 00112 CORBA::Policy *effective_client_protocol (ACE_ENV_SINGLE_ARG_DECL); 00113 00114 // The following attribute are used to cache 00115 // the different kind of policies and avoid to 00116 // parse the MProfile's policy list each time we 00117 // are asked about a given policy. 00118 00119 CORBA::Policy_var priority_model_policy_; 00120 00121 CORBA::Policy_var priority_banded_connection_policy_; 00122 00123 CORBA::Policy_var client_protocol_policy_; 00124 00125 CORBA::Boolean are_policies_parsed_; 00126 00127 private: 00128 // = Disallow copying and assignment. 00129 TAO_RT_Stub (const TAO_RT_Stub &); 00130 TAO_RT_Stub &operator = (const TAO_RT_Stub &); 00131 00132 }; 00133 00134 TAO_END_VERSIONED_NAMESPACE_DECL 00135 00136 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */ 00137 00138 #include /**/ "ace/post.h" 00139 00140 #endif /* TAO_RT_STUB_FACTORY_H_ */