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 (void)
17 Client_Request_Interceptor::name (void)
19 return CORBA::string_dup (this->myname_
);
23 Client_Request_Interceptor::destroy (void)
28 Client_Request_Interceptor::send_poll (
29 PortableInterceptor::ClientRequestInfo_ptr
)
35 Client_Request_Interceptor::send_request (
36 PortableInterceptor::ClientRequestInfo_ptr
)
42 Client_Request_Interceptor::receive_reply (
43 PortableInterceptor::ClientRequestInfo_ptr ri
)
48 // Try to get the RTCorbaPriority context. If its not there,
49 // report the fact via an exception.
50 IOP::ServiceContext_var sc
=
51 ri
->get_reply_service_context (IOP::RTCorbaPriority
);
53 catch (const CORBA::Exception
& ex
)
55 ex
._tao_print_exception ("Caught exception:");
57 ACE_DEBUG ((LM_DEBUG
, "EXCEPTION was most likely caused by the lack "
58 "of an IOP::RTCorbaPriority context in the reply.\n"));
65 Client_Request_Interceptor::receive_other (
66 PortableInterceptor::ClientRequestInfo_ptr
)
71 Client_Request_Interceptor::receive_exception (
72 PortableInterceptor::ClientRequestInfo_ptr ri
)
75 if (CORBA::is_nil (this->orb_
.in ()))
79 this->orb_
= CORBA::ORB_init (argc
, argv
,
83 CORBA::String_var operation
= ri
->operation ();
85 CORBA::Object_var target
= ri
->target ();
87 CORBA::String_var ior
=
88 this->orb_
->object_to_string (target
.in ());
91 "%s.received_exception "
92 "from \"%s\" on object: %s\n",
97 // Try to get the RTCorbaPriority context. If its not there,
98 // report the fact via an exception.
99 IOP::ServiceContext_var sc
=
100 ri
->get_reply_service_context (IOP::RTCorbaPriority
);