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 ()
12 : myname_ ("Echo_Server_Interceptor")
16 Echo_Server_Request_Interceptor::~Echo_Server_Request_Interceptor ()
21 Echo_Server_Request_Interceptor::name ()
23 return CORBA::string_dup (this->myname_
);
27 Echo_Server_Request_Interceptor::destroy ()
32 Echo_Server_Request_Interceptor::receive_request_service_contexts (
33 PortableInterceptor::ServerRequestInfo_ptr ri
)
35 CORBA::String_var operation
= ri
->operation ();
38 "%C.receive_request_service_contexts from "
43 IOP::ServiceId id
= ::service_id
;
44 IOP::ServiceContext_var sc
=
45 ri
->get_request_service_context (id
);
48 reinterpret_cast<const char *> (sc
->context_data
.get_buffer ());
51 " Received service context: %C\n",
55 if (ACE_OS::strcmp (buf
, request_msg
) != 0)
58 "ERROR: Echo_Server_Request_Interceptor::receive_request_service_contexts: "
59 "Expected request service context to be: %C\n",
67 Echo_Server_Request_Interceptor::receive_request (
68 PortableInterceptor::ServerRequestInfo_ptr
)
74 Echo_Server_Request_Interceptor::send_reply (
75 PortableInterceptor::ServerRequestInfo_ptr
)
80 Echo_Server_Request_Interceptor::send_exception (
81 PortableInterceptor::ServerRequestInfo_ptr
)
86 Echo_Server_Request_Interceptor::send_other (
87 PortableInterceptor::ServerRequestInfo_ptr
)