Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tests / RTCORBA / Bug_3382_Regression / interceptors.cpp
blobb714dfa3e497ee32e9930f1713074f9c3e8af87c
1 #include "interceptors.h"
2 #include "tao/OctetSeqC.h"
3 #include "ace/Log_Msg.h"
5 Client_Request_Interceptor::
6 Client_Request_Interceptor (const char *id)
7 : myname_ ("Client_Request_Interceptor"),
8 orb_id_ (CORBA::string_dup (id))
12 Client_Request_Interceptor::~Client_Request_Interceptor ()
16 char *
17 Client_Request_Interceptor::name ()
19 return CORBA::string_dup (this->myname_);
22 void
23 Client_Request_Interceptor::destroy ()
27 void
28 Client_Request_Interceptor::send_poll (
29 PortableInterceptor::ClientRequestInfo_ptr)
31 // Do Nothing
34 void
35 Client_Request_Interceptor::send_request (
36 PortableInterceptor::ClientRequestInfo_ptr)
38 // Do Nothing
41 void
42 Client_Request_Interceptor::receive_reply (
43 PortableInterceptor::ClientRequestInfo_ptr ri)
45 try
47 // Try to get the RTCorbaPriority context. If its not there,
48 // report the fact via an exception.
49 IOP::ServiceContext_var sc =
50 ri->get_reply_service_context (IOP::RTCorbaPriority);
52 catch (const CORBA::Exception& ex)
54 ex._tao_print_exception ("Caught exception:");
56 ACE_DEBUG ((LM_DEBUG, "EXCEPTION was most likely caused by the lack "
57 "of an IOP::RTCorbaPriority context in the reply.\n"));
58 throw;
63 void
64 Client_Request_Interceptor::receive_other (
65 PortableInterceptor::ClientRequestInfo_ptr)
69 void
70 Client_Request_Interceptor::receive_exception (
71 PortableInterceptor::ClientRequestInfo_ptr ri)
73 if (CORBA::is_nil (this->orb_.in ()))
75 int argc = 0;
76 ACE_TCHAR **argv = 0;
77 this->orb_ = CORBA::ORB_init (argc, argv,
78 this->orb_id_.in ());
81 CORBA::String_var operation = ri->operation ();
83 CORBA::Object_var target = ri->target ();
85 CORBA::String_var ior =
86 this->orb_->object_to_string (target.in ());
88 ACE_DEBUG ((LM_DEBUG,
89 "%s.received_exception "
90 "from \"%s\" on object: %s\n",
91 this->myname_,
92 operation.in (),
93 ior.in ()));
95 // Try to get the RTCorbaPriority context. If its not there,
96 // report the fact via an exception.
97 IOP::ServiceContext_var sc =
98 ri->get_reply_service_context (IOP::RTCorbaPriority);