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 ()
17 Client_Request_Interceptor::name ()
19 return CORBA::string_dup (this->myname_
);
23 Client_Request_Interceptor::destroy ()
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
)
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"));
64 Client_Request_Interceptor::receive_other (
65 PortableInterceptor::ClientRequestInfo_ptr
)
70 Client_Request_Interceptor::receive_exception (
71 PortableInterceptor::ClientRequestInfo_ptr ri
)
73 if (CORBA::is_nil (this->orb_
.in ()))
77 this->orb_
= CORBA::ORB_init (argc
, argv
,
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 ());
89 "%s.received_exception "
90 "from \"%s\" on object: %s\n",
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
);