Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Portable_Interceptors / PICurrent / ClientRequestInterceptor2.cpp
blob04cb706bf196bfc9f58bcdb68a521fea66c2820a
1 #include "ClientRequestInterceptor2.h"
2 #include "tao/CORBA_String.h"
3 #include "ace/Log_Msg.h"
4 #include "ace/OS_NS_string.h"
6 ClientRequestInterceptor2::ClientRequestInterceptor2 (
7 PortableInterceptor::SlotId id)
8 : slot_id_ (id)
12 char *
13 ClientRequestInterceptor2::name ()
15 return CORBA::string_dup ("ClientRequestInterceptor2");
18 void
19 ClientRequestInterceptor2::destroy (void)
23 void
24 ClientRequestInterceptor2::send_request (
25 PortableInterceptor::ClientRequestInfo_ptr ri)
27 CORBA::String_var op = ri->operation ();
29 if (ACE_OS::strcmp (op.in (), "invoke_you") != 0)
30 return; // Don't mess with PICurrent if not invoking test method.
32 try
34 // The goal of this test is to verify that a request scope
35 // current was successfully shallow copied from a TSC that
36 // itself was shallow copied from a ServerRequestInfo's RSC.
37 // Specifically, verify that the RSC->TSC->RSC sequence of
38 // copies occurred correctly.
40 // Retrieve data from the RSC (request scope current).
41 CORBA::Long number = 0;
43 CORBA::Any_var data =
44 ri->get_slot (this->slot_id_);
46 if (!(data.in () >>= number))
48 ACE_ERROR ((LM_ERROR,
49 "(%P|%t) ERROR: Unable to extract data from "
50 "CORBA::Any retrieved from RSC.\n"));
52 throw CORBA::INTERNAL ();
55 ACE_DEBUG ((LM_DEBUG,
56 "(%P|%t) Extracted <%d> from RSC slot %u\n",
57 number,
58 this->slot_id_));
60 catch (const PortableInterceptor::InvalidSlot& ex)
62 ex._tao_print_exception ("Exception thrown in ""send_request()\n");
64 ACE_DEBUG ((LM_DEBUG,
65 "Invalid slot: %u\n",
66 this->slot_id_));
68 throw CORBA::INTERNAL ();
71 ACE_DEBUG ((LM_INFO,
72 "(%P|%t) RSC->TSC->RSC copying appears to be working.\n"));
75 void
76 ClientRequestInterceptor2::send_poll (
77 PortableInterceptor::ClientRequestInfo_ptr)
81 void
82 ClientRequestInterceptor2::receive_reply (
83 PortableInterceptor::ClientRequestInfo_ptr)
87 void
88 ClientRequestInterceptor2::receive_exception (
89 PortableInterceptor::ClientRequestInfo_ptr)
93 void
94 ClientRequestInterceptor2::receive_other (
95 PortableInterceptor::ClientRequestInfo_ptr)