Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / DSI_Gateway / test_dsi.cpp
blob1ab1810fd525cddc8d26ccec2de28bf6e95dd889
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 (0);
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 (void)
67 return PortableServer::POA::_duplicate (this->poa_.in ());