00001 // -*- C++ -*- 00002 00003 // =================================================================== 00004 /** 00005 * @file IORInfo.h 00006 * 00007 * $Id: IORInfo.h 81429 2008-04-24 18:49:54Z johnnyw $ 00008 * 00009 * @author Ossama Othman <ossama@uci.edu> 00010 */ 00011 // =================================================================== 00012 00013 #ifndef TAO_IOR_INFO_H 00014 #define TAO_IOR_INFO_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #include "tao/IORInterceptor/IORInfoC.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 #include "tao/LocalObject.h" 00025 00026 // This is to remove "inherits via dominance" warnings from MSVC. 00027 // MSVC is being a little too paranoid. 00028 #if defined(_MSC_VER) 00029 #pragma warning(push) 00030 #pragma warning(disable:4250) 00031 #endif /* _MSC_VER */ 00032 00033 00034 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00035 00036 /// Forward declarations. 00037 class TAO_Root_POA; 00038 00039 /** 00040 * @class TAO_IORInfo 00041 * 00042 * @brief This class exposes an interface that allows IORInterceptors add 00043 * tagged components to IORs. 00044 */ 00045 class TAO_IORInfo 00046 : public virtual PortableInterceptor::IORInfo, 00047 public virtual ::CORBA::LocalObject 00048 { 00049 public: 00050 00051 /// Constructor. 00052 TAO_IORInfo (TAO_Root_POA *poa); 00053 00054 /** 00055 * @name PortableInterceptor::IORInfo Methods 00056 * 00057 * Methods exposed by the PortableInterceptor::IORInfo interface. 00058 */ 00059 //@{ 00060 00061 /// Return the policy matching the given policy type that is in 00062 /// effect for the object whose IOR is being created. 00063 virtual CORBA::Policy_ptr get_effective_policy (CORBA::PolicyType type); 00064 00065 /// Add the given tagged component to all profiles. 00066 virtual void add_ior_component (const IOP::TaggedComponent & component); 00067 00068 /// Add the given tagged component to all profiles matching the given 00069 /// ProfileId. 00070 virtual void add_ior_component_to_profile ( 00071 const IOP::TaggedComponent & component, 00072 IOP::ProfileId profile_id); 00073 00074 virtual char * manager_id (void); 00075 00076 virtual PortableInterceptor::AdapterState state (void); 00077 00078 virtual PortableInterceptor::ObjectReferenceTemplate *adapter_template (void); 00079 00080 virtual PortableInterceptor::ObjectReferenceFactory *current_factory (void); 00081 00082 virtual void current_factory ( 00083 PortableInterceptor::ObjectReferenceFactory * current_factory); 00084 00085 //@} 00086 00087 /// Invalidate this IORInfo instance. 00088 /** 00089 * Once the IOR interception points have been invoked, this IORInfo 00090 * instance is no longer valid. 00091 */ 00092 void invalidate (void); 00093 00094 /// Inform the this IORInfo object that the 00095 /// IORInterceptor::components_established() interception point has 00096 /// been called. 00097 /** 00098 * This method is used to inform the IORInfo object when the 00099 * add_ior_component() and add_ior_component_to_profile() methods 00100 * are invalid. They are only valid in the 00101 * IORInterceptor::establish_components() interception point. 00102 */ 00103 void components_established (void); 00104 00105 protected: 00106 00107 /// Protected destructor to enforce proper memory managment through 00108 /// the reference counting mechanism. 00109 ~TAO_IORInfo (void); 00110 00111 /// Check if this IORInfo instance is valid. 00112 /** 00113 * Once all IORInterceptor interception points have been called, 00114 * this IORInfo object is no longer valid. Throw an exception in 00115 * that case. 00116 */ 00117 void check_validity (void); 00118 00119 private: 00120 00121 /// Prevent copying through the copy constructor and the assignment 00122 /// operator. 00123 TAO_IORInfo (const TAO_IORInfo &); 00124 void operator= (const TAO_IORInfo &); 00125 00126 private: 00127 00128 /// Pointer to POA 00129 TAO_Root_POA * poa_; 00130 00131 /// True if the IORInterceptor::components_established() 00132 /// interception point was called. False otherwise. 00133 /** 00134 * This flag is used to prevent the add_ior_component() and 00135 * add_ior_component_to_profile() methods from being incorrectly 00136 * called after the IORInterceptor::establish_components() 00137 * interception point has been called. 00138 */ 00139 CORBA::Boolean components_established_; 00140 00141 }; 00142 00143 TAO_END_VERSIONED_NAMESPACE_DECL 00144 00145 #if defined (__ACE_INLINE__) 00146 # include "tao/IORInterceptor/IORInfo.inl" 00147 #endif /* __ACE_INLINE__ */ 00148 00149 #if defined(_MSC_VER) 00150 #pragma warning(pop) 00151 #endif /* _MSC_VER */ 00152 00153 #include /**/ "ace/post.h" 00154 00155 #endif /* TAO_IOR_INFO_H */