00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file ClientRequestInterceptor_Adapter_Impl.h 00006 * 00007 * ClientRequestInterceptor_Adapter_Impl.h,v 1.11 2006/03/10 07:19:12 jtc Exp 00008 * 00009 * This file an adapter class to simplify the support of 00010 * interceptors. 00011 * 00012 * @author Nanbor Wang <nanbor@cs.wustl.edu> 00013 * @author Ossama Othman <ossama@uci.edu> 00014 * @author Kirthika Parameswaran <kirthika@cs.wustl.edu> 00015 * @author Johnny Willemsen <jwillemsen@remedy.nl> 00016 */ 00017 //============================================================================= 00018 00019 #ifndef TAO_CLIENT_REQUEST_INTERCEPTOR_ADAPTER_IMPL_H 00020 #define TAO_CLIENT_REQUEST_INTERCEPTOR_ADAPTER_IMPL_H 00021 00022 #include /**/ "ace/pre.h" 00023 00024 #include "tao/orbconf.h" 00025 00026 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00027 # pragma once 00028 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00029 00030 00031 #if TAO_HAS_INTERCEPTORS == 1 00032 00033 #include "tao/PI/Interceptor_List_T.h" 00034 #include "tao/PI/ClientRequestInterceptorC.h" 00035 #include "tao/PI/ClientRequestDetails.h" 00036 #include "tao/ClientRequestInterceptor_Adapter.h" 00037 00038 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00039 00040 namespace TAO 00041 { 00042 typedef Interceptor_List< ::PortableInterceptor::ClientRequestInterceptor, 00043 ClientRequestDetails> 00044 ClientRequestInterceptor_List; 00045 } 00046 00047 class TAO_ClientRequestInfo; 00048 00049 namespace TAO 00050 { 00051 class Invocation_Base; 00052 00053 /** 00054 * @class ClientRequestInterceptor_Adapter 00055 * 00056 * @brief A convenient helper class to invoke registered client request 00057 * interceptors 00058 * 00059 * This class invokes all registered interceptors at interception 00060 * point, and enforces flow rules dictated by the Portable Interceptor 00061 * specification/chapter. 00062 */ 00063 class ClientRequestInterceptor_Adapter_Impl 00064 : public ClientRequestInterceptor_Adapter 00065 { 00066 public: 00067 00068 ClientRequestInterceptor_Adapter_Impl (void); 00069 00070 /** 00071 * @name PortableInterceptor Client Side Interception Points 00072 * 00073 * Each of these methods corresponds to a client side interception 00074 * point. There are no "intermediate" interception points on the 00075 * client side, only "starting" and "ending" interception points. 00076 * 00077 */ 00078 //@{ 00079 /// This method implements one of the "starting" client side 00080 /// interception points. 00081 virtual void send_request (Invocation_Base &invocation 00082 ACE_ENV_ARG_DECL); 00083 00084 /// This method implements one of the "ending" client side 00085 /// interception point. 00086 virtual void receive_reply (Invocation_Base &invocation 00087 ACE_ENV_ARG_DECL); 00088 00089 /// This method implements one of the "ending" client side 00090 /// interception point. 00091 virtual void receive_exception (Invocation_Base &invocation 00092 ACE_ENV_ARG_DECL); 00093 00094 /// This method implements one of the "ending" client side 00095 /// interception point. 00096 virtual void receive_other (Invocation_Base &invocation 00097 ACE_ENV_ARG_DECL); 00098 //@} 00099 00100 /// Register an interceptor. 00101 virtual void add_interceptor ( 00102 PortableInterceptor::ClientRequestInterceptor_ptr interceptor 00103 ACE_ENV_ARG_DECL); 00104 00105 /// Register an interceptor with policies. 00106 virtual void add_interceptor ( 00107 PortableInterceptor::ClientRequestInterceptor_ptr interceptor, 00108 const CORBA::PolicyList& policies 00109 ACE_ENV_ARG_DECL); 00110 00111 virtual void destroy_interceptors (ACE_ENV_SINGLE_ARG_DECL); 00112 00113 virtual PortableInterceptor::ReplyStatus reply_status ( 00114 TAO::Invocation_Base const &invocation_base); 00115 00116 protected: 00117 00118 /// Process the given PortableInterceptor::ForwardRequest exception, 00119 /// i.e. invoke the receive_other() interception point, in addition 00120 /// to notifying the Invocation object of the LOCATION_FORWARD. 00121 void process_forward_request (Invocation_Base &invocation, 00122 PortableInterceptor::ForwardRequest &exc 00123 ACE_ENV_ARG_DECL); 00124 00125 private: 00126 00127 /// List of registered interceptors. 00128 ClientRequestInterceptor_List interceptor_list_; 00129 }; 00130 } 00131 00132 TAO_END_VERSIONED_NAMESPACE_DECL 00133 00134 #if defined (__ACE_INLINE__) 00135 #include "tao/PI/ClientRequestInterceptor_Adapter_Impl.inl" 00136 #endif /* __ACE_INLINE__ */ 00137 00138 #endif /* TAO_HAS_INTERCEPTORS == 1 */ 00139 00140 #include /**/ "ace/post.h" 00141 00142 #endif /* TAO_CLIENT_REQUEST_INTERCEPTOR_ADAPTER_IMPL_H */