Merge pull request #2317 from jwillemsen/jwi-deleteop
[ACE_TAO.git] / TAO / interop-tests / CdrOutArg / tao / server_interceptor.cpp
blobac639a0e1c98fa3394573eb8682f533d533bcd7f
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 ()
20 char *
21 Echo_Server_Request_Interceptor::name ()
23 return CORBA::string_dup (this->myname_);
26 void
27 Echo_Server_Request_Interceptor::destroy ()
31 void
32 Echo_Server_Request_Interceptor::receive_request_service_contexts (
33 PortableInterceptor::ServerRequestInfo_ptr ri)
35 CORBA::String_var operation = ri->operation ();
37 ACE_DEBUG ((LM_DEBUG,
38 "%C.receive_request_service_contexts from "
39 "\"%C\"\n",
40 this->myname_,
41 operation.in ()));
43 IOP::ServiceId id = ::service_id;
44 IOP::ServiceContext_var sc =
45 ri->get_request_service_context (id);
47 const char *buf =
48 reinterpret_cast<const char *> (sc->context_data.get_buffer ());
49 #if 0
50 ACE_DEBUG ((LM_DEBUG,
51 " Received service context: %C\n",
52 buf));
53 #endif /*if 0*/
55 if (ACE_OS::strcmp (buf, request_msg) != 0)
57 ACE_ERROR ((LM_ERROR,
58 "ERROR: Echo_Server_Request_Interceptor::receive_request_service_contexts: "
59 "Expected request service context to be: %C\n",
60 request_msg));
66 void
67 Echo_Server_Request_Interceptor::receive_request (
68 PortableInterceptor::ServerRequestInfo_ptr)
70 // Do nothing
73 void
74 Echo_Server_Request_Interceptor::send_reply (
75 PortableInterceptor::ServerRequestInfo_ptr )
79 void
80 Echo_Server_Request_Interceptor::send_exception (
81 PortableInterceptor::ServerRequestInfo_ptr )
85 void
86 Echo_Server_Request_Interceptor::send_other (
87 PortableInterceptor::ServerRequestInfo_ptr)