summaryrefslogtreecommitdiff
path: root/TAO/tests/Bug_2935_Regression/middle_i.cpp
blob: ef8c2b2cfd649a20eb12952bb8ab9de7a9209af4 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// $Id$

#include "middle_i.h"
#include "ace/OS_NS_time.h"
#include "ace/OS_NS_string.h"

ACE_RCSID(Time, Middle_i, "$Id$")

Middle_i::Middle_i (CORBA::ORB_ptr orb, ThreeTier_ptr target)
  : orb_(CORBA::ORB::_duplicate (orb))
  , target_(ThreeTier::_duplicate (target))
{
//  ACE_DEBUG((LM_DEBUG, "Middle (%P|%t) Construct middle_i @%8.8x\n", this));
}

Middle_i::~Middle_i ()
{
}


bool
Middle_i::parse_args(int /*argc*/ , ACE_TCHAR* /*argv*/[] )
{
  return true;
}

// Implement the tick method

void
Middle_i::tick ()
{
  ACE_DEBUG((LM_DEBUG, "Middle (%P|%t) tick.\n"));
  try
    {
      target_->tick();
    }
  catch (const CORBA::UserException& userex)
    {
      userex._tao_print_exception ("MIDDLE::tick User Exception in run");
    }
  catch (const CORBA::SystemException& sysex)
    {
      sysex._tao_print_exception ("MIDDLE::tick System Exception in run");
    }
}

void
Middle_i::tock ()
{
  ACE_DEBUG((LM_DEBUG, "Middle (%P|%t) tock.\n"));
  try
    {
      target_->tock();
    }
  catch (const CORBA::UserException& userex)
    {
      userex._tao_print_exception ("MIDDLE::tock User Exception in run");
      throw;
    }
  catch (const CORBA::SystemException& sysex)
    {
      sysex._tao_print_exception ("MIDDLE::tock System Exception in run");
      throw;
    }
}

::CORBA::ULong
Middle_i::tickCount ()
{
  ACE_DEBUG((LM_DEBUG, "Middle (%P|%t) tickCount.\n"));
  try
    {
      return target_->tickCount();
    }
  catch (const CORBA::UserException& userex)
    {
      userex._tao_print_exception ("MIDDLE::tickCount User Exception in run");
      throw;
    }
  catch (const CORBA::SystemException& sysex)
    {
      sysex._tao_print_exception ("MIDDLE::tickCount System Exception in run");
      throw;
    }
}

::CORBA::ULong
Middle_i::tockCount ()
{
  ACE_DEBUG((LM_DEBUG, "Middle (%P|%t) tockCount.\n"));
  try
    {
      return target_->tockCount();
    }
  catch (const CORBA::UserException& userex)
    {
      userex._tao_print_exception ("MIDDLE::tockCount User Exception in run");
      throw;
    }
  catch (const CORBA::SystemException& sysex)
    {
      sysex._tao_print_exception ("MIDDLE::tockCount System Exception in run");
      throw;
    }
}


// Shutdown.

void
Middle_i::shutdown ()
{
  ACE_DEBUG((LM_DEBUG, "Middle (%P|%t) shutdown.\n"));
  target_->shutdown();
  ACE_DEBUG ((LM_DEBUG, "Middle_i is shutting down"));

  // Instruct the ORB to shutdown.
  this->orb_->shutdown (false);
}