1 #include "server_interceptor.h"
2 #include "tao/OctetSeqC.h"
4 #include "ace/Log_Msg.h"
5 #include "ace/OS_NS_string.h"
7 const IOP::ServiceId service_id
= 0xdeadbeef;
8 const char *request_msg
= "12345678";
11 Echo_Server_Request_Interceptor::Echo_Server_Request_Interceptor (void)
12 : myname_ ("Echo_Server_Interceptor")
16 Echo_Server_Request_Interceptor::~Echo_Server_Request_Interceptor (void)
21 Echo_Server_Request_Interceptor::name (void)
23 return CORBA::string_dup (this->myname_
);
27 Echo_Server_Request_Interceptor::destroy (void)
32 Echo_Server_Request_Interceptor::receive_request_service_contexts (
33 PortableInterceptor::ServerRequestInfo_ptr ri
)
36 CORBA::String_var operation
= ri
->operation ();
39 "%C.receive_request_service_contexts from "
44 IOP::ServiceId id
= ::service_id
;
45 IOP::ServiceContext_var sc
=
46 ri
->get_request_service_context (id
);
49 reinterpret_cast<const char *> (sc
->context_data
.get_buffer ());
52 " Received service context: %C\n",
56 if (ACE_OS::strcmp (buf
, request_msg
) != 0)
59 "ERROR: Echo_Server_Request_Interceptor::receive_request_service_contexts: "
60 "Expected request service context to be: %C\n",
68 Echo_Server_Request_Interceptor::receive_request (
69 PortableInterceptor::ServerRequestInfo_ptr
)
75 Echo_Server_Request_Interceptor::send_reply (
76 PortableInterceptor::ServerRequestInfo_ptr
)
81 Echo_Server_Request_Interceptor::send_exception (
82 PortableInterceptor::ServerRequestInfo_ptr
)
87 Echo_Server_Request_Interceptor::send_other (
88 PortableInterceptor::ServerRequestInfo_ptr
)