summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Notify/lib/Command.cpp
blob: 1704b36dcc196bf3cae01e522cec1be36ef3a818 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// $Id$

#include "Command.h"

#include "tao/Exception.h"
#include "tao/Environment.h"

#include "ace/Log_Msg.h"

ACE_RCSID(lib, TAO_Command, "$Id$")

TAO_Notify_Tests_Command::TAO_Notify_Tests_Command (void)
  :next_ (0), command_ (INVALID)
{
}

TAO_Notify_Tests_Command::~TAO_Notify_Tests_Command ()
{
}

void
TAO_Notify_Tests_Command::init (ACE_Arg_Shifter& /*arg_shifter*/)
{
  // default: do nothing.
}

void
TAO_Notify_Tests_Command::next (TAO_Notify_Tests_Command* command)
{
  this->next_ = command;
}

void
TAO_Notify_Tests_Command::execute (void)
{
  if (this->command_ == INVALID)
    {
      ACE_DEBUG ((LM_DEBUG, "Invalid command: %s\n", this->get_name ()));
    }
  else
    {
      ACE_DEBUG ((LM_DEBUG, "Executing command: %s\n", this->get_name ()));

      try
        {
          this->execute_i ();
        }
      catch (const CORBA::Exception& ex)
        {
          ex._tao_print_exception (
            ACE_TEXT(
              "Error: Exception running command\n"));
        }
    }

  if (this->next_)
    this->next_->execute ();
}