summaryrefslogtreecommitdiff
path: root/TAO/interop-tests/CdrOutArg/orbix/server_interceptor.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/interop-tests/CdrOutArg/orbix/server_interceptor.cxx')
-rw-r--r--TAO/interop-tests/CdrOutArg/orbix/server_interceptor.cxx88
1 files changed, 88 insertions, 0 deletions
diff --git a/TAO/interop-tests/CdrOutArg/orbix/server_interceptor.cxx b/TAO/interop-tests/CdrOutArg/orbix/server_interceptor.cxx
new file mode 100644
index 00000000000..718757bd1a0
--- /dev/null
+++ b/TAO/interop-tests/CdrOutArg/orbix/server_interceptor.cxx
@@ -0,0 +1,88 @@
+// $Id$
+
+#include <stdio.h>
+#include "server_interceptor.h"
+
+const IOP::ServiceId service_id = 0xdeadbeef;
+const char *request_msg = "12345678";
+
+
+Echo_Server_Request_Interceptor::Echo_Server_Request_Interceptor (void)
+ : myname_ ("Echo_Server_Interceptor")
+{
+}
+
+Echo_Server_Request_Interceptor::~Echo_Server_Request_Interceptor (void)
+{
+}
+
+char *
+Echo_Server_Request_Interceptor::name (void)
+{
+ return CORBA::string_dup (this->myname_);
+}
+
+void
+Echo_Server_Request_Interceptor::destroy (void)
+{
+}
+
+void
+Echo_Server_Request_Interceptor::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+{
+
+ CORBA::String_var operation = ri->operation ();
+
+ printf("%s.receive_request_service_contexts from "
+ "\"%s\"\n",
+ this->myname_,
+ operation.in ());
+
+ IOP::ServiceId id = ::service_id;
+ IOP::ServiceContext_var sc =
+ ri->get_request_service_context (id);
+
+ const char *buf =
+ reinterpret_cast<const char *> (sc->context_data.get_buffer ());
+#if 0
+ ACE_DEBUG ((LM_DEBUG,
+ " Received service context: %C\n",
+ buf));
+#endif /*if 0*/
+
+ if (strcmp (buf, request_msg) != 0)
+ {
+ printf("ERROR: Echo_Server_Request_Interceptor::receive_request_service_contexts: "
+ "Expected request service context to be: %s\n",
+ request_msg);
+ _exit(1);
+ }
+
+}
+
+
+void
+Echo_Server_Request_Interceptor::receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr)
+{
+ // Do nothing
+}
+
+void
+Echo_Server_Request_Interceptor::send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr )
+{
+}
+
+void
+Echo_Server_Request_Interceptor::send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr )
+{
+}
+
+void
+Echo_Server_Request_Interceptor::send_other (
+ PortableInterceptor::ServerRequestInfo_ptr)
+{
+}