summaryrefslogtreecommitdiff
path: root/TAO/tests/NestedUpcall/Triangle_Test/Object_A_Impl.cpp
blob: eaad01edc7cdcf55682869c6aa22272879889345 (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
// $Id$

// ============================================================================
//
// = LIBRARY
//    TAO/tests/NestedUpCalls/Triangle_Test
//
// = FILENAME
//    Object_A_Impl.cpp
//
// = DESCRIPTION
//    This class implements the Object A  of the
//    Nested Upcalls - Triangle test.
//
// = AUTHORS
//    Michael Kircher
//
// ============================================================================

#include "tao/corba.h"
#include "Object_A_Impl.h"

ACE_RCSID(Triangle_Test, Object_A_Impl, "$Id$")

// CTOR
Object_A_Impl::Object_A_Impl (void)
: finish_two_way_call_ (0)
{
}

// DTOR
Object_A_Impl::~Object_A_Impl (void)
{
}



void
Object_A_Impl::foo (Initiator_ptr initiator_ptr,
                    CORBA::Environment &env)
{
  ACE_DEBUG ((LM_DEBUG,
              "(%P|%t) BEGIN Object_A_Impl::foo ()\n"));

  TAO_TRY
    {
      initiator_ptr->foo_object_B (TAO_TRY_ENV);
      TAO_CHECK_ENV;

      while (!this->finish_two_way_call_)
        TAO_ORB_Core_instance ()->reactor ()->handle_events ();
    }
  TAO_CATCHANY
    {
      TAO_TRY_ENV.print_exception ("calling the initiator");
    }
  TAO_ENDTRY;

  ACE_DEBUG ((LM_DEBUG,
              "(%P|%t) END Object_A_Impl::foo ()\n"));
}

void
Object_A_Impl::finish (CORBA::Environment &env)
{
  ACE_DEBUG ((LM_DEBUG,
              "(%P|%t) BEGIN Object_A_Impl::finish ()\n"));

  this->finish_two_way_call_ = 1;

  ACE_DEBUG ((LM_DEBUG,
              "(%P|%t) END Object_A_Impl::finish ()\n"));

}