summaryrefslogtreecommitdiff
path: root/TAO/tests/NestedUpcall/Reactor/reactor_i.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tests/NestedUpcall/Reactor/reactor_i.cpp')
-rw-r--r--TAO/tests/NestedUpcall/Reactor/reactor_i.cpp107
1 files changed, 107 insertions, 0 deletions
diff --git a/TAO/tests/NestedUpcall/Reactor/reactor_i.cpp b/TAO/tests/NestedUpcall/Reactor/reactor_i.cpp
new file mode 100644
index 00000000000..b14fe96ae29
--- /dev/null
+++ b/TAO/tests/NestedUpcall/Reactor/reactor_i.cpp
@@ -0,0 +1,107 @@
+// $Id$
+
+#include "tao/corba.h"
+#include "reactor_i.h"
+
+ACE_RCSID(Reactor, reactor_i, "$Id$")
+
+// CTOR
+Reactor_i::Reactor_i (void)
+ : quiet_ (0)
+{
+}
+
+// DTOR
+Reactor_i::~Reactor_i (void)
+{
+}
+
+void
+Reactor_i::be_quiet (int quiet)
+{
+ this->quiet_ = quiet;
+}
+
+// register...with nothing
+CORBA::Long
+Reactor_i::register_handler (EventHandler_ptr eh,
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (!this->quiet_)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) BEGIN Reactor_i::register_handler ()\n"));
+
+ CORBA::Long r = 0;
+
+ ACE_TRY
+ {
+ r = eh->peer (ACE_TRY_ENV);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "getting peer");
+ }
+ ACE_ENDTRY;
+
+ if (!this->quiet_)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) got this value from peer: %d\n",
+ r));
+
+ if (!this->quiet_)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) END Reactor_i::register_handler ()\n"));
+
+ return 0;
+}
+
+void
+Reactor_i::set_value (CORBA::Environment &)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (!this->quiet_)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) doing Reactor_i::set_value()\n"));
+}
+
+CORBA::UShort
+Reactor_i::decrement (EventHandler_ptr eh,
+ CORBA::UShort num,
+ CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (!this->quiet_)
+ ACE_DEBUG ((LM_DEBUG, "%{%I(%P|%t) Reactor::decrement (%d)%$", num));
+
+ CORBA::UShort ret;
+ if (--num <= 0)
+ ret = 0;
+ else
+ {
+ if (!this->quiet_)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Reactor::decrement() "
+ "invoking EventHandler::decrement(%d)%$", num));
+
+ Reactor_var me = _this (env);
+ ret = eh->decrement (me.in (), num, env);
+ }
+
+ if (!this->quiet_)
+ ACE_DEBUG ((LM_DEBUG,
+ "%}(%P|%t) Reactor::decrement() "
+ "returning %d\n", ret));
+
+ return ret;
+}
+
+void
+Reactor_i::stop (CORBA::Environment &)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // @@ TODO Keep an ORB pointer around...
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) stopping.\n"));
+ TAO_ORB_Core_instance ()->orb ()->shutdown ();
+}