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"
25 #include "ace/Atomic_Op.h"
29 #pragma warning(disable:4250)
32 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
33 class TAO_LB_LoadAlert
;
34 TAO_END_VERSIONED_NAMESPACE_DECL
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
51 ServerRequestInterceptor ();
54 * @name Methods Required by the ServerRequestInterceptor
57 * These are the canonical methods required for all
58 * ServerRequestInterceptors.
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
);
81 CORBA::Long
request_count ();
86 * Protected destructor to enforce correct memory management via
89 ~ServerRequestInterceptor ();
92 /// The number of requests that have arrived on the server.
93 ACE_Atomic_Op
<TAO_SYNCH_MUTEX
, long> request_count_
;
101 #endif /* TAO_SERVER_REQUEST_INTERCEPTOR_H */