4 #include "tao/PortableServer/ForwardRequestC.h"
6 test_i::test_i (CORBA::Short id
,
11 , orb_ (CORBA::ORB::_duplicate (orb
))
12 , to_ (CORBA::Object::_nil ())
13 , request_pass_count_ (0)
19 test_i::forward (CORBA::Object_ptr to
,
20 CORBA::ULong request_pass_count
)
22 this->to_
= CORBA::Object::_duplicate (to
);
23 this->request_pass_count_
= request_pass_count
;
27 test_i::collocated_call (void)
29 this->request_count_
++;
32 "Collocated call is executed in object with id %d.\n",
35 if (!CORBA::is_nil (this->to_
.in ()))
37 if (this->request_count_
== this->request_pass_count_
)
40 "SERVER: Request %d will be forwarded "
41 "to object 'to'\nSERVER: via collocated_call().\n",
42 this->request_count_
));
44 // Throw forward exception
45 throw PortableServer::ForwardRequest (this->to_
.in ());