ServerInterceptorAdapter.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    ServerInterceptorAdapter.h
00006  *
00007  *  ServerInterceptorAdapter.h,v 1.9 2006/06/26 09:24:20 sma Exp
00008  *
00009  *   This file contains a helper class to simplify the support of
00010  *   interceptors in TAO_IDL generated skeletons.
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_SERVER_INTERCEPTOR_ADAPTER_H
00019 #define TAO_SERVER_INTERCEPTOR_ADAPTER_H
00020 
00021 #include /**/ "ace/pre.h"
00022 
00023 #include "tao/orbconf.h"
00024 
00025 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00026 # pragma once
00027 #endif /* ACE_LACKS_PRAGMA_ONCE */
00028 
00029 
00030 #if TAO_HAS_INTERCEPTORS == 1
00031 
00032 #include "tao/PI_Server/ServerRequestInterceptorC.h"
00033 
00034 #include "tao/PI/Interceptor_List_T.h"
00035 #include "tao/ServerRequestInterceptor_Adapter.h"
00036 #include "tao/Basic_Types.h"
00037 #include "tao/PI_Server/ServerRequestDetails.h"
00038 
00039 
00040 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00041 
00042 namespace TAO
00043 {
00044   typedef Interceptor_List< ::PortableInterceptor::ServerRequestInterceptor,
00045                             ServerRequestDetails>
00046     ServerRequestInterceptor_List;
00047 }
00048 
00049 namespace CORBA
00050 {
00051   class PolicyList;
00052 }
00053 
00054 class TAO_ServerRequest;
00055 
00056 namespace TAO
00057 {
00058   class ServerRequestInfo;
00059 
00060   /**
00061    * @class ServerRequestInterceptor_Adapter_Impl
00062    *
00063    * @brief ServerRequestInterceptor_Adapter_Impl
00064    *
00065    * A convenient helper class to invoke registered server request
00066    * interceptor(s).
00067    */
00068   class ServerRequestInterceptor_Adapter_Impl
00069     : public ServerRequestInterceptor_Adapter
00070   {
00071   public:
00072 
00073     /// Constructor.
00074     ServerRequestInterceptor_Adapter_Impl (void);
00075 
00076     /**
00077      * @name PortableInterceptor Server Side Interception Points
00078      *
00079      * Each of these methods corresponds to a server side interception
00080      * point.
00081      */
00082     //@{
00083 #if TAO_HAS_EXTENDED_FT_INTERCEPTORS == 1
00084     /// This method implements the "starting" server side interception
00085     /// point. It will be used as the first interception point and it is
00086     /// proprietary to TAO.
00087     /// @@ Will go away once Bug 1369 is fixed
00088     void tao_ft_interception_point (
00089         TAO_ServerRequest &server_request,
00090         TAO::Argument * const args[],
00091         size_t nargs,
00092         void * servant_upcall,
00093         CORBA::TypeCode_ptr const * exceptions,
00094         CORBA::ULong nexceptions,
00095         CORBA::OctetSeq_out oc
00096         ACE_ENV_ARG_DECL);
00097 #endif /*TAO_HAS_EXTENDED_FT_INTERCEPTORS*/
00098 
00099     /// This method implements the "intermediate" server side
00100     /// interception point if the above #ifdef is set to 1 and a
00101     /// starting intercetion point if it is not set to 1.
00102     ///
00103     /// @note This method should have been the "starting" interception
00104     ///       point according to the interceptor spec. This will be
00105     ///       fixed once Bug 1369 is completely done.
00106     void receive_request_service_contexts (
00107         TAO_ServerRequest &server_request,
00108         TAO::Argument * const args[],
00109         size_t nargs,
00110         void * servant_upcall,
00111         CORBA::TypeCode_ptr const * exceptions,
00112         CORBA::ULong nexceptions
00113         ACE_ENV_ARG_DECL);
00114 
00115     /// This method an "intermediate" server side interception point.
00116     void receive_request (
00117         TAO_ServerRequest &server_request,
00118         TAO::Argument * const args[],
00119         size_t nargs,
00120         void * servant_upcall,
00121         CORBA::TypeCode_ptr const * exceptions,
00122         CORBA::ULong nexceptions
00123         ACE_ENV_ARG_DECL);
00124 
00125     /// This method implements one of the "ending" server side
00126     /// interception points.
00127     void send_reply (
00128         TAO_ServerRequest &server_request,
00129         TAO::Argument * const args[],
00130         size_t nargs,
00131         void * servant_upcall,
00132         CORBA::TypeCode_ptr const * exceptions,
00133         CORBA::ULong nexceptions
00134         ACE_ENV_ARG_DECL);
00135 
00136     /// This method implements one of the "ending" server side
00137     /// interception points.
00138     void send_exception (
00139         TAO_ServerRequest &server_request,
00140         TAO::Argument * const args[],
00141         size_t nargs,
00142         void * servant_upcall,
00143         CORBA::TypeCode_ptr const * exceptions,
00144         CORBA::ULong nexceptions
00145         ACE_ENV_ARG_DECL);
00146 
00147     /// This method implements one of the "ending" server side
00148     /// interception points.
00149     void send_other (
00150         TAO_ServerRequest &server_request,
00151         TAO::Argument * const args[],
00152         size_t nargs,
00153         void * servant_upcall,
00154         CORBA::TypeCode_ptr const * exceptions,
00155         CORBA::ULong nexceptions
00156         ACE_ENV_ARG_DECL);
00157     //@}
00158 
00159     /// Register an interceptor.
00160     virtual void add_interceptor (
00161       PortableInterceptor::ServerRequestInterceptor_ptr interceptor
00162       ACE_ENV_ARG_DECL);
00163 
00164     virtual void add_interceptor (
00165       PortableInterceptor::ServerRequestInterceptor_ptr interceptor,
00166       const CORBA::PolicyList& policies
00167       ACE_ENV_ARG_DECL);
00168 
00169     virtual void destroy_interceptors (ACE_ENV_SINGLE_ARG_DECL);
00170 
00171     virtual TAO::PICurrent_Impl *allocate_pi_current (void);
00172 
00173     virtual void deallocate_pi_current (
00174         TAO::PICurrent_Impl *picurrent);
00175 
00176     virtual void execute_command (
00177         TAO_ServerRequest &server_request,
00178         TAO::Upcall_Command &command
00179         ACE_ENV_ARG_DECL);
00180 
00181   private:
00182 
00183     /// List of registered interceptors.
00184     ServerRequestInterceptor_List interceptor_list_;
00185   };
00186 
00187 }  // End namespace TAO
00188 
00189 TAO_END_VERSIONED_NAMESPACE_DECL
00190 
00191 #endif  /* TAO_HAS_INTERCEPTORS */
00192 
00193 #include /**/ "ace/post.h"
00194 
00195 #endif /* TAO_SERVER_INTERCEPTOR_ADAPTER_H */

Generated on Thu Nov 9 12:53:59 2006 for TAO_PI_Server by doxygen 1.3.6