blob: ebc3a86b3451dd279756d3bfcee1f281851755db (
plain)
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
|
// $Id$
#include "orbsvcs/LoadBalancing/LB_ClientRequestInterceptor.h"
#include "orbsvcs/CosLoadBalancingC.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
char *
TAO_LB_ClientRequestInterceptor::name ()
{
return CORBA::string_dup ("TAO_LB_ClientRequestInterceptor");
}
void
TAO_LB_ClientRequestInterceptor::destroy (void)
{
}
void
TAO_LB_ClientRequestInterceptor::send_request (
PortableInterceptor::ClientRequestInfo_ptr ri)
{
/*
CORBA::Object_var t = ri->target ();
*/
// A ServiceContext with an empty payload (i.e. zero length
// context_data) will be embedded into the request.
IOP::ServiceContext service_context;
service_context.context_id = CosLoadBalancing::LOAD_MANAGED;
/*
// A CDR encapsulation IOP::Codec could be used here, but it uses
// interpreted marshaling, which is slower than the compiled
// marshaling used below.
TAO_OutputCDR cdr;
cdr << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER);
// Marshal the target object, i.e. the object reference that points
// back to the object group into the ServiceContextList.
cdr << t.in ();
// TAO extension, replace the contents of the octet sequence with
// the CDR stream.
const CORBA::ULong tl = cdr.total_length ();
service_context.context_data.length (tl);
CORBA::Octet * buf = service_context.context_data.get_buffer ();
for (const ACE_Message_Block * i = cdr.begin ();
i != 0;
i = i->cont ())
{
const size_t len = i->length ();
// @todo It would be nice to avoid this copy.
ACE_OS::memcpy (buf, i->rd_ptr (), len);
buf += len;
}
*/
const CORBA::Boolean replace = 0;
ri->add_request_service_context (service_context, replace);
}
void
TAO_LB_ClientRequestInterceptor::send_poll (
PortableInterceptor::ClientRequestInfo_ptr)
{
}
void
TAO_LB_ClientRequestInterceptor::receive_reply (
PortableInterceptor::ClientRequestInfo_ptr)
{
}
void
TAO_LB_ClientRequestInterceptor::receive_exception (
PortableInterceptor::ClientRequestInfo_ptr)
{
}
void
TAO_LB_ClientRequestInterceptor::receive_other (
PortableInterceptor::ClientRequestInfo_ptr)
{
}
TAO_END_VERSIONED_NAMESPACE_DECL
|