3 //=============================================================================
5 * @file Client_Request_Interceptor.h
7 * Implementation header for the client request interceptor for the
8 * Transport::Current test.
10 * @author Ossama Othman <ossama@uci.edu>
12 //=============================================================================
14 #ifndef CLIENT_REQUEST_INTERCEPTOR_H
15 #define CLIENT_REQUEST_INTERCEPTOR_H
17 #include /**/ "ace/config.h"
18 #include /**/ "Current_Test_Export.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #include "tao/PI/PI.h"
25 #include "tao/PortableInterceptorC.h"
26 #include "tao/LocalObject.h"
28 #include "tao/CORBA_String.h"
32 /// A metod doing the actual testing, so we could change it for the
33 /// different traits implementations
34 typedef int (*TEST
) (CORBA::ORB_ptr
);
38 * @class Client_Request_Interceptor
40 * @brief Client request interceptor that exercises
41 * Transport::Current support.
43 * This client request interceptor forwards a request to a secondary
44 * object by throwing the PortableInterceptor::ForwardRequest
45 * exception from within the send_request() interception point. It
46 * only forwards the initial request. See the README file for
49 class Current_Test_Export Client_Request_Interceptor
50 : public virtual PortableInterceptor::ClientRequestInterceptor
,
51 public virtual ::CORBA::LocalObject
55 Client_Request_Interceptor (const char *orb_id
,
58 * @name Methods Required by the Client Request Interceptor
61 * These are methods that must be implemented since they are pure
62 * virtual in the abstract base class. They are the canonical
63 * methods required for all client request interceptors.
66 /// Return the name of this ClientRequestinterceptor.
67 virtual char * name ();
69 virtual void destroy ();
71 virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri
);
73 virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr ri
);
75 virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri
);
77 virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri
);
79 virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr ri
);
82 // Number of interceptions
83 CORBA::Long
interceptions ();
86 // Implementation method, every inteception point will have to
87 // call it, supplying a name.
88 void test_transport_current (const ACE_TCHAR
* amethod
);
91 ///The ID of the ORB this interceptor is registered with.
92 CORBA::String_var orb_id_
;
94 /// Pseudo-reference to the ORB this interceptor is registered
98 /// The number of requests intercepted by this interceptor.
99 CORBA::ULong request_count_
;
101 /// Stringified reference to the object the initial request will be
102 /// forwarded to by this interceptor.
103 CORBA::String_var forward_str_
;
105 /// Synchronize internal state...
106 TAO_SYNCH_MUTEX lock_
;
108 /// Unique request ID
109 unsigned long requestID_
;
116 #endif /* CLIENT_REQUEST_INTERCEPTOR_H */