00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file ClientRequestInterceptor_Adapter.h 00006 * 00007 * $Id: ClientRequestInterceptor_Adapter.h 85371 2009-05-18 13:39:38Z sma $ 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 */ 00016 //============================================================================= 00017 00018 #ifndef TAO_CLIENT_REQUEST_INTERCEPTOR_ADAPTER_H 00019 #define TAO_CLIENT_REQUEST_INTERCEPTOR_ADAPTER_H 00020 00021 #include /**/ "ace/pre.h" 00022 00023 #include /**/ "tao/TAO_Export.h" 00024 #include "tao/RequestInterceptor_Adapter.h" 00025 00026 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00027 # pragma once 00028 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00029 00030 #include "tao/Invocation_Utils.h" 00031 #include "tao/Basic_Types.h" 00032 00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00034 00035 class TAO_ClientRequestInfo; 00036 00037 namespace PortableInterceptor 00038 { 00039 class ClientRequestInterceptor; 00040 typedef ClientRequestInterceptor *ClientRequestInterceptor_ptr; 00041 00042 typedef CORBA::Short ReplyStatus; 00043 } 00044 00045 namespace CORBA 00046 { 00047 class PolicyList; 00048 } 00049 00050 namespace TAO 00051 { 00052 class Invocation_Base; 00053 00054 /** 00055 * @class ClientRequestInterceptor_Adapter 00056 * 00057 * @brief A convenient helper class to invoke registered client request 00058 * interceptors 00059 * 00060 * This class invokes all registered interceptors at interception 00061 * point, and enforces flow rules dictated by the Portable Interceptor 00062 * specification/chapter. 00063 */ 00064 class TAO_Export ClientRequestInterceptor_Adapter 00065 : public RequestInterceptor_Adapter 00066 { 00067 public: 00068 virtual ~ClientRequestInterceptor_Adapter (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) = 0; 00082 00083 /// This method implements one of the "ending" client side 00084 /// interception point. 00085 virtual void receive_reply (Invocation_Base &invocation) = 0; 00086 00087 /// This method implements one of the "ending" client side 00088 /// interception point. 00089 virtual void receive_exception (Invocation_Base &invocation) = 0; 00090 00091 /// This method implements one of the "ending" client side 00092 /// interception point. 00093 virtual void receive_other (Invocation_Base &invocation) = 0; 00094 00095 /// Register an interceptor. 00096 virtual void add_interceptor ( 00097 PortableInterceptor::ClientRequestInterceptor_ptr interceptor) = 0; 00098 00099 /// Register an interceptor with policies. 00100 virtual void add_interceptor ( 00101 PortableInterceptor::ClientRequestInterceptor_ptr interceptor, 00102 const CORBA::PolicyList& policies) = 0; 00103 00104 /// Convert TAO Invocation status to a PI status 00105 virtual PortableInterceptor::ReplyStatus pi_reply_status ( 00106 TAO::Invocation_Base const &invocation_base) = 0; 00107 }; 00108 } 00109 00110 TAO_END_VERSIONED_NAMESPACE_DECL 00111 00112 #include /**/ "ace/post.h" 00113 00114 #endif /* TAO_CLIENT_REQUEST_INTERCEPTOR_ADAPTER_H */