Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / examples / LoadBalancing / ServerRequestInterceptor.h
blob70e212dfda8d7ead3df273d41f394c91b92e7e1e
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"
25 #include "ace/Atomic_Op.h"
27 #if defined(_MSC_VER)
28 #pragma warning(push)
29 #pragma warning(disable:4250)
30 #endif /* _MSC_VER */
32 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
33 class TAO_LB_LoadAlert;
34 TAO_END_VERSIONED_NAMESPACE_DECL
36 /**
37 * @class ServerRequestInterceptor
39 * @brief ServerRequestInterceptor that calculates the number of
40 * requests arriving per second.
42 * This ServerRequestInterceptor is responsible for redirecting
43 * requests back to the LoadManager.
45 class ServerRequestInterceptor
46 : public virtual PortableInterceptor::ServerRequestInterceptor,
47 public virtual ::CORBA::LocalObject
49 public:
50 /// Constructor.
51 ServerRequestInterceptor ();
53 /**
54 * @name Methods Required by the ServerRequestInterceptor
55 * Interface
57 * These are the canonical methods required for all
58 * ServerRequestInterceptors.
60 //@{
61 virtual char * name ();
63 virtual void destroy ();
65 virtual void receive_request_service_contexts (
66 PortableInterceptor::ServerRequestInfo_ptr ri);
68 virtual void receive_request (
69 PortableInterceptor::ServerRequestInfo_ptr ri);
71 virtual void send_reply (
72 PortableInterceptor::ServerRequestInfo_ptr ri);
74 virtual void send_exception (
75 PortableInterceptor::ServerRequestInfo_ptr ri);
77 virtual void send_other (
78 PortableInterceptor::ServerRequestInfo_ptr ri);
79 //@}
81 CORBA::Long request_count ();
83 protected:
84 /// Destructor.
85 /**
86 * Protected destructor to enforce correct memory management via
87 * reference counting.
89 ~ServerRequestInterceptor ();
91 private:
92 /// The number of requests that have arrived on the server.
93 ACE_Atomic_Op<TAO_SYNCH_MUTEX, long> request_count_;
96 #if defined(_MSC_VER)
97 #pragma warning(pop)
98 #endif /* _MSC_VER */
101 #endif /* TAO_SERVER_REQUEST_INTERCEPTOR_H */