summaryrefslogtreecommitdiff
path: root/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientTask.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tests/CSD_Strategy_Tests/TP_Common/ClientTask.cpp')
-rw-r--r--TAO/tests/CSD_Strategy_Tests/TP_Common/ClientTask.cpp116
1 files changed, 0 insertions, 116 deletions
diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientTask.cpp b/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientTask.cpp
deleted file mode 100644
index 00d92a17608..00000000000
--- a/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientTask.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-// $Id$
-#include "ClientTask.h"
-#include "ClientEngine.h"
-#include "AppShutdown.h"
-#include "ace/SString.h"
-
-
-ClientTask::ClientTask(bool shutdown_after_done)
-: shutdown_after_done_(shutdown_after_done),
- failure_count_(0)
-{
-}
-
-
-ClientTask::~ClientTask()
-{
-}
-
-
-void
-ClientTask::add_engine(ClientEngine* engine)
-{
- // Pass in false so that _add_ref() is called.
- ClientEngine_Handle engine_handle(engine,false);
- this->engines_.push_back(engine_handle);
-}
-
-
-int
-ClientTask::open(void*)
-{
- size_t num_threads = this->engines_.size();
-
- if (num_threads == 0)
- {
- ACE_ERROR_RETURN((LM_ERROR,
- "(%P|%t) ClientTask cannot activate 0 threads.\n"),
- -1);
- }
-
- if (this->activate(THR_NEW_LWP | THR_JOINABLE, num_threads) != 0)
- {
- // Assumes that when activate returns non-zero return code that
- // no threads were activated.
- ACE_ERROR_RETURN((LM_ERROR,
- "(%P|%t) ClientTask failed to activate "
- "the %d client threads.\n", num_threads),
- -1);
- }
-
- return 0;
-}
-
-
-int
-ClientTask::svc()
-{
- ClientEngine_Handle engine;
-
- {
- GuardType guard(this->lock_);
- this->engines_.get(engine, this->engines_.size() - 1);
- this->engines_.pop_back();
- }
-
- ACE_TRY_NEW_ENV
- {
- bool exec_ret = engine->execute(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
- if (exec_ret == false)
- {
- GuardType guard(this->lock_);
- this->failure_count_ ++;
- }
- }
- ACE_CATCHANY
- {
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "ClientTask::svc Caught exception from execute():");
-
- GuardType guard(this->lock_);
- this->failure_count_ ++;
- }
- ACE_CATCHALL
- {
- ACE_ERROR((LM_ERROR,
- "(%P|%t) ClientTask::svc caught unknown (...) exception "\
- "in execute() " ));
- GuardType guard(this->lock_);
- this->failure_count_ ++;
- }
- ACE_ENDTRY;
-
- if(this->shutdown_after_done_)
- {
- // This is used to shutdown orb for a client application
- // with an orb running.
- TheAppShutdown->client_done ();
- }
-
- return 0;
-}
-
-
-int
-ClientTask::close(u_long)
-{
- return 0;
-}
-
-
-unsigned
-ClientTask::failure_count () const
-{
- return this->failure_count_;
-}