Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

ClientInterceptorAdapter.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    ClientInterceptorAdapter.h
00006  *
00007  *  $Id: ClientInterceptorAdapter.h,v 1.1.1.2 2003/02/21 18:36:44 chad Exp $
00008  *
00009  *   This file an adapter class to simplify the support of
00010  *   interceptors in tao_idl generated stubs.
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 
00019 #ifndef TAO_CLIENT_INTERCEPTOR_ADAPTER_H
00020 #define TAO_CLIENT_INTERCEPTOR_ADAPTER_H
00021 
00022 #include "ace/pre.h"
00023 
00024 #include "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 "Interceptor_List.h"
00034 
00035 // Forward declarations
00036 class TAO_GIOP_Invocation;
00037 class TAO_ClientRequestInfo;
00038 class TAO_ClientRequestInfo_i;
00039 
00040 /**
00041  * @class TAO_ClientRequestInterceptor_Adapter
00042  *
00043  * @brief A convenient helper class to invoke registered client request
00044  *        interceptors in client stubs.
00045  *
00046  * This class invokes all registered interceptors at interception
00047  * point, and enforces flow rules dictated by the Portable Interceptor
00048  * specification/chapter.
00049  */
00050 class TAO_Export TAO_ClientRequestInterceptor_Adapter
00051 {
00052 
00053 public:
00054 
00055   TAO_ClientRequestInterceptor_Adapter (
00056     TAO_ClientRequestInterceptor_List::TYPE & interceptors,
00057     TAO_GIOP_Invocation * invocation,
00058     int & _invoke_status);
00059 
00060   ~TAO_ClientRequestInterceptor_Adapter (void);
00061 
00062   /**
00063    * @name PortableInterceptor Client Side Interception Points
00064    *
00065    * Each of these methods corresponds to a client side interception
00066    * point.  There are no "intermediate" interception points on the
00067    * client side, only "starting" and "ending" interception points.
00068    *
00069    * @todo
00070    * The "send_poll()" and "receive_other()" (for AMI)
00071    * PortableInterceptor interception points are missing.
00072    */
00073   //@{
00074   /// This method implements one of the "starting" client side
00075   /// interception points.
00076   void send_request (TAO_ClientRequestInfo_i * ri
00077                      ACE_ENV_ARG_DECL);
00078 
00079   /// This method implements one of the "ending" client side
00080   /// interception point.
00081   void receive_reply (TAO_ClientRequestInfo_i * ri
00082                       ACE_ENV_ARG_DECL);
00083 
00084   /// This method implements one of the "ending" client side
00085   /// interception point.
00086   void receive_exception (TAO_ClientRequestInfo_i * ri
00087                           ACE_ENV_ARG_DECL);
00088 
00089   /// This method implements one of the "ending" client side
00090   /// interception point.
00091   void receive_other (TAO_ClientRequestInfo_i * ri
00092                       ACE_ENV_ARG_DECL);
00093   //@}
00094 
00095 protected:
00096 
00097   /// Process the given PortableInterceptor::ForwardRequest exception,
00098   /// i.e. invoke the receive_other() interception point, in addition
00099   /// to notifying the Invocation object of the LOCATION_FORWARD.
00100   void process_forward_request (TAO_ClientRequestInfo_i * ri,
00101                                 PortableInterceptor::ForwardRequest & exc
00102                                 ACE_ENV_ARG_DECL);
00103 
00104 private:
00105 
00106   /// Reference to the list of registered interceptors.
00107   TAO_ClientRequestInterceptor_List::TYPE & interceptors_;
00108 
00109   /// Pointer to the GIOP invocation object for the current request.
00110   TAO_GIOP_Invocation * invocation_;
00111 
00112   /// Reference to the invocation status obtained from and returned to
00113   /// the stub.  Needed to support the
00114   /// PortableInterceptor::ForwardRequest exception.
00115   int & invoke_status_;
00116 
00117   /// Cache the length of the interceptor list so that we don't have
00118   /// to compute it at each stage of the current interception.
00119   const size_t len_;
00120 
00121   /// The number of interceptors "pushed" onto the logical flow
00122   /// stack.  This is used when unwinding the flow stack.
00123   size_t stack_size_;
00124 
00125   /// Pointer to the PortableInterceptor::ClientRequestInfo
00126   /// implementation.
00127   /**
00128    * @note The fact that a pointer to the
00129    *       PortableInterceptor::ClientRequestInfo object in TSS is
00130    *       cached here assumes that all client side interception
00131    *       points are invoked in the same thread.  This may not be the
00132    *       case for AMI!  In that case, we'll have to perform a TSS
00133    *       access in each interception point.
00134    */
00135   TAO_ClientRequestInfo * info_;
00136 
00137 };
00138 
00139 #if defined (__ACE_INLINE__)
00140 #include "ClientInterceptorAdapter.inl"
00141 #endif  /* __ACE_INLINE__ */
00142 
00143 #endif /* TAO_HAS_INTERCEPTORS */
00144 
00145 #include "ace/post.h"
00146 
00147 #endif /* TAO_CLIENT_INTERCEPTOR_ADAPTER_H */

Generated on Mon Jun 16 13:48:04 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002