Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / tests / Bug_3216_Regression / ServerRequest_Interceptor.cpp
blobe2c58cf865df30b0aba6fa82df520e0371806287
1 // -*- C++ -*-
2 #include "ServerRequest_Interceptor.h"
3 #include "orbsvcs/FT_CORBA_ORBC.h"
4 #include "tao/IOPC.h"
5 #include "tao/ORB_Constants.h"
6 #include "tao/AnyTypeCode/DynamicC.h"
7 #include "tao/AnyTypeCode/TypeCode.h"
8 #include "tao/CDR.h"
9 #include "ace/Log_Msg.h"
10 #include "ace/OS_NS_string.h"
11 #include "Hello.h"
13 TAO249_ServerRequest_Interceptor::TAO249_ServerRequest_Interceptor (void)
14 : orb_ (0),
15 client_id_ (0)
19 TAO249_ServerRequest_Interceptor::~TAO249_ServerRequest_Interceptor (void)
24 char *
25 TAO249_ServerRequest_Interceptor::name ()
27 return CORBA::string_dup ("TAO_TAO249_ServerRequest_Interceptor");
30 void
31 TAO249_ServerRequest_Interceptor::destroy ()
35 void
36 TAO249_ServerRequest_Interceptor::receive_request_service_contexts (
37 PortableInterceptor::ServerRequestInfo_ptr
42 void
43 TAO249_ServerRequest_Interceptor::receive_request (
44 PortableInterceptor::ServerRequestInfo_ptr ri
47 CORBA::String_var op = ri->operation ();
49 try
51 IOP::ServiceContext_var sc =
52 ri->get_request_service_context (IOP::FT_GROUP_VERSION
56 TAO_InputCDR cdr (reinterpret_cast <const char*>
57 (sc->context_data.get_buffer ()),
58 sc->context_data.length ());
60 CORBA::Boolean byte_order;
62 if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
64 throw CORBA::BAD_PARAM (CORBA::OMGVMCID | 28,
65 CORBA::COMPLETED_NO);
69 cdr.reset_byte_order (static_cast <int> (byte_order));
71 Hello::normal_context_ok_ = 0;
72 Hello::extended_context_ok_ = 0;
74 if (! ACE_OS::strcmp (op.in (), "check_normal_context"))
76 FT::FTGroupVersionServiceContext ftrsc;
77 Hello::normal_context_ok_ = (cdr >> ftrsc) != 0;
79 else if (! ACE_OS::strcmp (op.in (), "check_extended_context"))
81 FT::TagFTGroupTaggedComponent tftgtc;
82 Hello::extended_context_ok_ = (cdr >> tftgtc) != 0;
85 catch (const CORBA::Exception& ex)
87 ACE_DEBUG ((LM_ERROR, "Unexpected (non regression) error - test failed\n"));
88 ex._tao_print_exception (
89 "Exception in TAO249_ServerRequest_Interceptor::receive_request\n");
90 throw;
97 void
98 TAO249_ServerRequest_Interceptor::send_reply (
99 PortableInterceptor::ServerRequestInfo_ptr
104 void
105 TAO249_ServerRequest_Interceptor::send_exception (
106 PortableInterceptor::ServerRequestInfo_ptr
111 void
112 TAO249_ServerRequest_Interceptor::send_other (
113 PortableInterceptor::ServerRequestInfo_ptr