Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / PI / ClientRequestInterceptor_Adapter_Impl.h
blob3f1c10c7af933fb9da8f8973a9430bc3d28a7c5e
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file ClientRequestInterceptor_Adapter_Impl.h
7 * This file an adapter class to simplify the support of
8 * interceptors.
10 * @author Nanbor Wang <nanbor@cs.wustl.edu>
11 * @author Ossama Othman <ossama@uci.edu>
12 * @author Kirthika Parameswaran <kirthika@cs.wustl.edu>
13 * @author Johnny Willemsen <jwillemsen@remedy.nl>
15 //=============================================================================
17 #ifndef TAO_CLIENT_REQUEST_INTERCEPTOR_ADAPTER_IMPL_H
18 #define TAO_CLIENT_REQUEST_INTERCEPTOR_ADAPTER_IMPL_H
20 #include /**/ "ace/pre.h"
22 #include "tao/orbconf.h"
24 #if !defined (ACE_LACKS_PRAGMA_ONCE)
25 # pragma once
26 #endif /* ACE_LACKS_PRAGMA_ONCE */
29 #if TAO_HAS_INTERCEPTORS == 1
31 #include "tao/PI/Interceptor_List_T.h"
32 #include "tao/PI/PI_includeC.h"
33 #include "tao/PI/ClientRequestDetails.h"
34 #include "tao/PI/RequestInterceptor_Adapter_Impl.h"
35 #include "tao/ClientRequestInterceptor_Adapter.h"
37 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
39 namespace TAO
41 typedef Interceptor_List< ::PortableInterceptor::ClientRequestInterceptor,
42 ClientRequestDetails>
43 ClientRequestInterceptor_List;
46 class TAO_ClientRequestInfo;
48 namespace TAO
50 class Invocation_Base;
52 /**
53 * @class ClientRequestInterceptor_Adapter
55 * @brief A convenient helper class to invoke registered client request
56 * interceptors
58 * This class invokes all registered interceptors at interception
59 * point, and enforces flow rules dictated by the Portable Interceptor
60 * specification/chapter.
62 class ClientRequestInterceptor_Adapter_Impl
63 : public ClientRequestInterceptor_Adapter
64 , public TAO_RequestInterceptor_Adapter_Impl
66 public:
67 ClientRequestInterceptor_Adapter_Impl ();
69 /**
70 * @name PortableInterceptor Client Side Interception Points
72 * Each of these methods corresponds to a client side interception
73 * point. There are no "intermediate" interception points on the
74 * client side, only "starting" and "ending" interception points.
77 //@{
78 /// This method implements one of the "starting" client side
79 /// interception points.
80 virtual void send_request (Invocation_Base &invocation);
82 /// This method implements one of the "ending" client side
83 /// interception point.
84 virtual void receive_reply (Invocation_Base &invocation);
86 /// This method implements one of the "ending" client side
87 /// interception point.
88 virtual void receive_exception (Invocation_Base &invocation);
90 /// This method implements one of the "ending" client side
91 /// interception point.
92 virtual void receive_other (Invocation_Base &invocation);
93 //@}
95 /// Register an interceptor.
96 virtual void add_interceptor (
97 PortableInterceptor::ClientRequestInterceptor_ptr interceptor);
99 /// Register an interceptor with policies.
100 virtual void add_interceptor (
101 PortableInterceptor::ClientRequestInterceptor_ptr interceptor,
102 const CORBA::PolicyList& policies);
104 virtual void destroy_interceptors ();
106 virtual PortableInterceptor::ReplyStatus pi_reply_status (
107 TAO::Invocation_Base const &invocation_base);
109 void popTSC (TAO_ORB_Core *orb_core)
110 {TAO_RequestInterceptor_Adapter_Impl::popTSC (orb_core);}
111 void pushTSC (TAO_ORB_Core *orb_core)
112 {TAO_RequestInterceptor_Adapter_Impl::pushTSC (orb_core);}
114 protected:
115 /// Process the given PortableInterceptor::ForwardRequest exception,
116 /// i.e. invoke the receive_other() interception point, in addition
117 /// to notifying the Invocation object of the LOCATION_FORWARD.
118 void process_forward_request (Invocation_Base &invocation,
119 const PortableInterceptor::ForwardRequest &exc);
121 private:
122 /// List of registered interceptors.
123 ClientRequestInterceptor_List interceptor_list_;
127 TAO_END_VERSIONED_NAMESPACE_DECL
129 #if defined (__ACE_INLINE__)
130 #include "tao/PI/ClientRequestInterceptor_Adapter_Impl.inl"
131 #endif /* __ACE_INLINE__ */
133 #endif /* TAO_HAS_INTERCEPTORS == 1 */
135 #include /**/ "ace/post.h"
137 #endif /* TAO_CLIENT_REQUEST_INTERCEPTOR_ADAPTER_IMPL_H */