summaryrefslogtreecommitdiff
path: root/TAO/tests/ForwardOnceUponException/test_i.cpp
blob: e139a027d6c45d1d2ee514e4257d94c3c5d889d4 (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
// $Id$

#include "test_i.h"

#if !defined(__ACE_INLINE__)
#include "test_i.inl"
#endif /* __ACE_INLINE__ */

extern int raise_exception;

CORBA::Boolean
Simple_Server_i::test_is_a (const char * /* type */)
{
  ++ this->ncalls_;

  if ((raise_exception & TAO::FOE_OBJECT_NOT_EXIST) == TAO::FOE_OBJECT_NOT_EXIST)
  {
    //ACE_DEBUG ((LM_DEBUG, "(%P|%t) test_is_a called %d and raise OBJECT_NOT_EXIST\n", ncalls_));
    throw ::CORBA::OBJECT_NOT_EXIST ();
  }

  if ((raise_exception & TAO::FOE_COMM_FAILURE) == TAO::FOE_COMM_FAILURE)
  {
    //ACE_DEBUG ((LM_DEBUG, "(%P|%t) test_is_a called %d and raise COMM_FAILURE\n", ncalls_));
    throw ::CORBA::COMM_FAILURE ();
  }

  if ((raise_exception & TAO::FOE_TRANSIENT) == TAO::FOE_TRANSIENT)
  {
    //ACE_DEBUG ((LM_DEBUG, "(%P|%t) test_is_a called %d and raise TRANSIENT\n", ncalls_));
    throw ::CORBA::TRANSIENT ();
  }

  if ((raise_exception & TAO::FOE_INV_OBJREF) == TAO::FOE_INV_OBJREF)
  {
    //ACE_DEBUG ((LM_DEBUG, "(%P|%t) test_is_a called %d and raise INV_OBJREF\n", ncalls_));
    throw ::CORBA::INV_OBJREF ();
  }

  return 0;
}

void
Simple_Server_i::shutdown (void)
{
  this->orb_->shutdown (0);
}