Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / tests / Bug_3853_Regression / client_interceptor.cpp
blob4451032eac28e1a0889f3fc6c20ef801c5faaeef
1 #include "client_interceptor.h"
2 #include "HelloC.h"
3 #include "ace/Log_Msg.h"
5 extern const ACE_TCHAR *server2_ior;
6 extern CORBA::ORB_var orb;
8 int isRecursive = 0;
9 extern Demo::HelloWorld_var server1_shutdownObj;
11 Echo_Client_Request_Interceptor::
12 Echo_Client_Request_Interceptor ()
13 : myname_ ("Echo_Client_Interceptor")
17 char *
18 Echo_Client_Request_Interceptor::name ()
20 return CORBA::string_dup (this->myname_);
23 void
24 Echo_Client_Request_Interceptor::destroy ()
28 void
29 Echo_Client_Request_Interceptor::send_poll (
30 PortableInterceptor::ClientRequestInfo_ptr)
32 // Do Nothing
35 void
36 Echo_Client_Request_Interceptor::send_request (
37 PortableInterceptor::ClientRequestInfo_ptr ri)
39 CORBA::String_var operation = ri->operation ();
40 if (ACE_OS::strcmp (operation.in (), "shutdown") == 0) {
41 return;
44 //send to another
45 isRecursive ++ ;
46 if (isRecursive%2 == 1 )
48 if (isRecursive == 3) {
49 ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t)Echo_Client_Request_Interceptor::send_request(%d) ")
50 ACE_TEXT ("shutdown server 1 now. \n"), isRecursive));
51 server1_shutdownObj->shutdown();
54 CORBA::Object_var helloObj = orb->string_to_object(server2_ior);
56 Demo::HelloWorld_var hello = Demo::HelloWorld::_narrow(helloObj.in ());
58 if (CORBA::is_nil(hello.in ())) {
59 ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t)Echo_Client_Request_Interceptor::send_request(%d) ")
60 ACE_TEXT ("hello reference is nil.\n"), isRecursive));
62 else {
63 ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t)Echo_Client_Request_Interceptor::send_request(%d) ")
64 ACE_TEXT ("call server2 HelloWorld::sayHello() \n"), isRecursive));
65 const char* pMsg = " server2 say Hello";
66 hello->sayHello(pMsg);
71 void
72 Echo_Client_Request_Interceptor::receive_reply (
73 PortableInterceptor::ClientRequestInfo_ptr)
77 void
78 Echo_Client_Request_Interceptor::receive_other (
79 PortableInterceptor::ClientRequestInfo_ptr)
83 void
84 Echo_Client_Request_Interceptor::receive_exception (
85 PortableInterceptor::ClientRequestInfo_ptr)