Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / orbsvcs / performance-tests / LoadBalancing / LBPerf / RPS / ServerRequestInterceptor.h
blob74e42791eb2d1dcde9b88abfc2fc86151f96f16e
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file ServerRequestInterceptor.h
7 * @author Ossama Othman <ossama@dre.vanderbilt.edu>
8 */
9 //=============================================================================
12 #ifndef TAO_SERVER_REQUEST_INTERCEPTOR_H
13 #define TAO_SERVER_REQUEST_INTERCEPTOR_H
15 #include "ace/config-all.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 # pragma once
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "tao/PI_Server/PI_Server.h"
22 #include "tao/PortableInterceptorC.h"
23 #include "tao/LocalObject.h"
24 #include "ace/Atomic_Op.h"
26 #if defined(_MSC_VER)
27 #pragma warning(push)
28 #pragma warning(disable:4250)
29 #endif /* _MSC_VER */
31 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
32 class TAO_LB_LoadAlert;
33 TAO_END_VERSIONED_NAMESPACE_DECL
35 /**
36 * @class ServerRequestInterceptor
38 * @brief ServerRequestInterceptor that calculates the number of
39 * requests arriving per second.
41 * This ServerRequestInterceptor is responsible for redirecting
42 * requests back to the LoadManager.
44 class ServerRequestInterceptor
45 : public virtual PortableInterceptor::ServerRequestInterceptor,
46 public virtual ::CORBA::LocalObject
48 public:
49 /// Constructor.
50 ServerRequestInterceptor ();
52 /**
53 * @name Methods Required by the ServerRequestInterceptor
54 * Interface
56 * These are the canonical methods required for all
57 * ServerRequestInterceptors.
59 //@{
60 virtual char * name ();
62 virtual void destroy ();
64 virtual void receive_request_service_contexts (
65 PortableInterceptor::ServerRequestInfo_ptr ri);
67 virtual void receive_request (
68 PortableInterceptor::ServerRequestInfo_ptr ri);
70 virtual void send_reply (
71 PortableInterceptor::ServerRequestInfo_ptr ri);
73 virtual void send_exception (
74 PortableInterceptor::ServerRequestInfo_ptr ri);
76 virtual void send_other (
77 PortableInterceptor::ServerRequestInfo_ptr ri);
78 //@}
80 CORBA::Long request_count ();
82 protected:
83 /// Destructor.
84 /**
85 * Protected destructor to enforce correct memory management via
86 * reference counting.
88 ~ServerRequestInterceptor ();
90 private:
91 /// The number of requests that have arrived on the server.
92 ACE_Atomic_Op<TAO_SYNCH_MUTEX, long> request_count_;
95 #if defined(_MSC_VER)
96 #pragma warning(pop)
97 #endif /* _MSC_VER */
100 #endif /* TAO_SERVER_REQUEST_INTERCEPTOR_H */