blob: aae2649e9ca955bf1da8f4299516dd3b29259617 (
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
|
// -*- C++ -*-
#include "test_i.h"
test_i::test_i (CORBA::Short num,
CORBA::ORB_ptr orb)
: number_ (num),
orb_ (CORBA::ORB::_duplicate (orb))
{
}
test_i::~test_i ()
{
}
CORBA::Short
test_i::number ()
{
++this->number_;
if (this->number_ == 3)
{
#if 1
// Either throw any of these 4 exceptions with completion status
// COMPLETED_NO and see how it's handled in receive_other() point.
throw ::CORBA::TRANSIENT (0, CORBA::COMPLETED_NO);
// throw ::CORBA::NO_RESPONSE (0, CORBA::COMPLETED_NO);
// throw ::CORBA::COMM_FAILURE (0, CORBA::COMPLETED_NO);
// throw ::CORBA::OBJ_ADAPTER (0, CORBA::COMPLETED_NO);
#else
// Or throw any other exception and see how it's handled in
// receive_exception() point on the client side.
throw ::CORBA::INTERNAL (0, CORBA::COMPLETED_NO);
#endif
}
return this->number_;
}
void
test_i::shutdown ()
{
ACE_DEBUG ((LM_DEBUG,
"SERVER: Server is shutting down at %d.\n",
this->number_));
this->orb_->shutdown (false);
}
|