1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
#include "ClientRequestInterceptor2.h"
#include "tao/CORBA_String.h"
#include "ace/Log_Msg.h"
#include "ace/OS_NS_string.h"
ACE_RCSID (PICurrent,
ClientRequestInterceptor2,
"$Id$")
ClientRequestInterceptor2::ClientRequestInterceptor2 (
PortableInterceptor::SlotId id)
: slot_id_ (id)
{
}
char *
ClientRequestInterceptor2::name (
ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
return CORBA::string_dup ("ClientRequestInterceptor2");
}
void
ClientRequestInterceptor2::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
}
void
ClientRequestInterceptor2::send_request (
PortableInterceptor::ClientRequestInfo_ptr ri
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
PortableInterceptor::ForwardRequest))
{
CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (ACE_OS::strcmp (op.in (), "invoke_you") != 0)
return; // Don't mess with PICurrent if not invoking test method.
ACE_TRY
{
// The goal of this test is to verify that a request scope
// current was successfully shallow copied from a TSC that
// itself was shallow copied from a ServerRequestInfo's RSC.
// Specifically, verify that the RSC->TSC->RSC sequence of
// copies occurred correctly.
// Retrieve data from the RSC (request scope current).
CORBA::Long number = 0;
CORBA::Any_var data =
ri->get_slot (this->slot_id_
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
if (!(data.in () >>= number))
{
ACE_ERROR ((LM_ERROR,
"(%P|%t) ERROR: Unable to extract data from "
"CORBA::Any retrieved from RSC.\n"));
ACE_TRY_THROW (CORBA::INTERNAL ());
}
ACE_DEBUG ((LM_DEBUG,
"(%P|%t) Extracted <%d> from RSC slot %u\n",
number,
this->slot_id_));
}
ACE_CATCH (PortableInterceptor::InvalidSlot, ex)
{
ACE_PRINT_EXCEPTION (ex,
"Exception thrown in "
"send_request()\n");
ACE_DEBUG ((LM_DEBUG,
"Invalid slot: %u\n",
this->slot_id_));
ACE_TRY_THROW (CORBA::INTERNAL ());
}
ACE_ENDTRY;
ACE_CHECK;
ACE_DEBUG ((LM_INFO,
"(%P|%t) RSC->TSC->RSC copying appears to be working.\n"));
}
void
ClientRequestInterceptor2::send_poll (
PortableInterceptor::ClientRequestInfo_ptr
ACE_ENV_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
}
void
ClientRequestInterceptor2::receive_reply (
PortableInterceptor::ClientRequestInfo_ptr
ACE_ENV_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
}
void
ClientRequestInterceptor2::receive_exception (
PortableInterceptor::ClientRequestInfo_ptr
ACE_ENV_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException,
PortableInterceptor::ForwardRequest))
{
}
void
ClientRequestInterceptor2::receive_other (
PortableInterceptor::ClientRequestInfo_ptr
ACE_ENV_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException,
PortableInterceptor::ForwardRequest))
{
}
|