Merge pull request #2301 from sonndinh/remove-dup-reactor-functions
[ACE_TAO.git] / TAO / tests / DSI_Gateway / test_dsi.cpp
blobd008b54fac92b447b1f68e37a7fad4a4160034d9
1 #include "test_dsi.h"
2 #include "tao/DynamicInterface/Request.h"
3 #include "tao/DynamicInterface/Unknown_User_Exception.h"
5 #if !defined(__ACE_INLINE__)
6 #include "test_dsi.inl"
7 #endif /* __ACE_INLINE__ */
9 void
10 DSI_Simple_Server::invoke (CORBA::ServerRequest_ptr request)
12 CORBA::NVList_ptr list;
13 this->orb_->create_list (0, list);
15 request->arguments (list);
17 CORBA::Request_var target_request;
19 this->target_->_create_request (0, // ctx
20 request->operation (),
21 list,
22 0, // result
23 0, // exception_list,
24 0, // context_list,
25 target_request.inout (),
26 0);
28 target_request->_tao_lazy_evaluation (1);
30 // Outgoing request must have the same byte order as the incoming one.
31 target_request->_tao_byte_order (request->_tao_incoming_byte_order ());
33 try
35 // Updates the byte order state, if necessary.
36 target_request->invoke ();
38 catch (const CORBA::UNKNOWN&)
40 // Outgoing reply must have the same byte order as the incoming one.
41 request->_tao_reply_byte_order (target_request->_tao_byte_order ());
43 request->gateway_exception_reply (target_request->raw_user_exception ());
45 return;
48 // Outgoing reply must have the same byte order as the incoming one.
49 request->_tao_reply_byte_order (target_request->_tao_byte_order ());
51 if (ACE_OS::strcmp ("shutdown", request->operation ()) == 0)
53 this->orb_->shutdown (false);
57 CORBA::RepositoryId
58 DSI_Simple_Server::_primary_interface (const PortableServer::ObjectId &,
59 PortableServer::POA_ptr)
61 return CORBA::string_dup ("IDL:Simple_Server:1.0");
64 PortableServer::POA_ptr
65 DSI_Simple_Server::_default_POA ()
67 return PortableServer::POA::_duplicate (this->poa_.in ());