3 //=============================================================================
5 * @file ServerRequestInterceptor.h
7 * @author Ossama Othman <ossama@dre.vanderbilt.edu>
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)
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"
28 #pragma warning(disable:4250)
31 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
32 class TAO_LB_LoadAlert
;
33 TAO_END_VERSIONED_NAMESPACE_DECL
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
50 ServerRequestInterceptor ();
53 * @name Methods Required by the ServerRequestInterceptor
56 * These are the canonical methods required for all
57 * ServerRequestInterceptors.
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
);
80 CORBA::Long
request_count ();
85 * Protected destructor to enforce correct memory management via
88 ~ServerRequestInterceptor ();
91 /// The number of requests that have arrived on the server.
92 ACE_Atomic_Op
<TAO_SYNCH_MUTEX
, long> request_count_
;
100 #endif /* TAO_SERVER_REQUEST_INTERCEPTOR_H */