summaryrefslogtreecommitdiff
path: root/ACE/TAO/tests/DSI_Gateway/test_dsi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/TAO/tests/DSI_Gateway/test_dsi.cpp')
-rw-r--r--ACE/TAO/tests/DSI_Gateway/test_dsi.cpp72
1 files changed, 72 insertions, 0 deletions
diff --git a/ACE/TAO/tests/DSI_Gateway/test_dsi.cpp b/ACE/TAO/tests/DSI_Gateway/test_dsi.cpp
new file mode 100644
index 00000000000..39c6e6ded6e
--- /dev/null
+++ b/ACE/TAO/tests/DSI_Gateway/test_dsi.cpp
@@ -0,0 +1,72 @@
+// $Id$
+
+#include "test_dsi.h"
+#include "tao/DynamicInterface/Request.h"
+#include "tao/DynamicInterface/Unknown_User_Exception.h"
+
+#if !defined(__ACE_INLINE__)
+#include "test_dsi.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(DSI_Gateway, test_dsi, "$Id$")
+
+void
+DSI_Simple_Server::invoke (CORBA::ServerRequest_ptr request)
+{
+ CORBA::NVList_ptr list;
+ this->orb_->create_list (0, list);
+
+ request->arguments (list);
+
+ CORBA::Request_var target_request;
+
+ this->target_->_create_request (0, // ctx
+ request->operation (),
+ list,
+ 0, // result
+ 0, // exception_list,
+ 0, // context_list,
+ target_request.inout (),
+ 0);
+
+ target_request->_tao_lazy_evaluation (1);
+
+ // Outgoing request must have the same byte order as the incoming one.
+ target_request->_tao_byte_order (request->_tao_incoming_byte_order ());
+
+ try
+ {
+ // Updates the byte order state, if necessary.
+ target_request->invoke ();
+ }
+ catch (const CORBA::UNKNOWN&)
+ {
+ // Outgoing reply must have the same byte order as the incoming one.
+ request->_tao_reply_byte_order (target_request->_tao_byte_order ());
+
+ request->gateway_exception_reply (target_request->raw_user_exception ());
+
+ return;
+ }
+
+ // Outgoing reply must have the same byte order as the incoming one.
+ request->_tao_reply_byte_order (target_request->_tao_byte_order ());
+
+ if (ACE_OS::strcmp ("shutdown", request->operation ()) == 0)
+ {
+ this->orb_->shutdown (0);
+ }
+}
+
+CORBA::RepositoryId
+DSI_Simple_Server::_primary_interface (const PortableServer::ObjectId &,
+ PortableServer::POA_ptr)
+{
+ return CORBA::string_dup ("IDL:Simple_Server:1.0");
+}
+
+PortableServer::POA_ptr
+DSI_Simple_Server::_default_POA (void)
+{
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+}