summaryrefslogtreecommitdiff
path: root/ACE/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbShutdownTask.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbShutdownTask.cpp')
-rw-r--r--ACE/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbShutdownTask.cpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/ACE/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbShutdownTask.cpp b/ACE/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbShutdownTask.cpp
new file mode 100644
index 00000000000..c7f01889e9c
--- /dev/null
+++ b/ACE/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbShutdownTask.cpp
@@ -0,0 +1,75 @@
+// This may look like C, but it's really -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file OrbShutdownTask.cpp
+ *
+ * $Id$
+ *
+ * @author Tim Bradley <bradley_t@ociweb.com>
+ */
+//=============================================================================
+
+#include "OrbShutdownTask.h"
+#include "ace/CORBA_macros.h"
+#include "ace/OS_NS_unistd.h"
+
+
+OrbShutdownTask::OrbShutdownTask()
+{
+}
+
+
+OrbShutdownTask::~OrbShutdownTask()
+{
+}
+
+
+void
+OrbShutdownTask::orb(CORBA::ORB_ptr orb)
+{
+ this->orb_ = CORBA::ORB::_duplicate(orb);
+}
+
+
+int
+OrbShutdownTask::open(void*)
+{
+ if (this->activate(THR_NEW_LWP | THR_JOINABLE, 1) != 0)
+ {
+ //FUZZ: disable check_for_lack_ACE_OS
+ // Assumes that when activate returns non-zero return code that
+ // no threads were activated.
+ ACE_ERROR_RETURN((LM_ERROR,
+ "(%P|%t) OrbShutdownTask failed to open().\n"),
+ -1);
+ //FUZZ: enable check_for_lack_ACE_OS
+ }
+
+ return 0;
+}
+
+
+int
+OrbShutdownTask::svc()
+{
+ try
+ {
+ this->orb_->shutdown(0);
+ }
+ catch (...)
+ {
+ ACE_ERROR((LM_ERROR,
+ "(%P|%t) Exception raised by ORB::shutdown() call "
+ "in OrbShutdownTask::svc().\n"));
+ }
+
+ return 0;
+}
+
+
+int
+OrbShutdownTask::close(u_long)
+{
+ return 0;
+}