1 #include "amh_ami_pch.h"
4 // ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
5 // TAO and the TAO IDL Compiler have been developed by the Center for
6 // Distributed Object Computing at Washington University, St. Louis.
8 // Information about TAO is available at:
9 // http://www.dre.vanderbilt.edu/~schmidt/TAO.html
15 // Implementation skeleton constructor
16 Asynch_Middle_i::Asynch_Middle_i (PortableServer::POA_ptr poa
,
18 : poa_ (PortableServer::POA::_duplicate(poa
)),
19 inner_ (Inner::_duplicate(inner
))
24 Asynch_Middle_i::get_the_answer (AMH_MiddleResponseHandler_ptr _tao_rh
,
25 const char * question
)
27 // The callback handler servant instance holds on to a reference to the
28 // AMH response handler. That way, it can forward the reply back to the
29 // originial client after getting the reply from the inner server.
30 PortableServer::ServantBase_var servant
= new Inner_callback_i(this->poa_
.in(),
32 PortableServer::ObjectId_var objid
=
33 this->poa_
->activate_object(servant
.in());
34 CORBA::Object_var obj
= this->poa_
->id_to_reference (objid
.in());
36 AMI_InnerHandler_var cb
= AMI_InnerHandler::_narrow(obj
.in());
38 // forward the request on to the inner server, with the callback handler
40 this->inner_
->sendc_answer (cb
.in(),question
);
42 // nothing else to do. Our client will block until the callback handler
43 // forwards the reply.
47 //------------------------------------------------------------------------
49 // Implementation skeleton constructor
50 Middle_i::Middle_i (Inner_ptr inner
)
51 : inner_ (Inner::_duplicate(inner
))
56 Middle_i::get_the_answer ( const char * question
)
58 return inner_
->answer (question
);