blob: c9fb4b2e48db79227f76978adab22da791c04780 (
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
|
// $Id$
#include "Client_Task.h"
#include "testC.h"
#include "interceptors.h"
Client_Task::Client_Task (const ACE_TCHAR *ior,
CORBA::ORB_ptr corb,
ACE_Thread_Manager *thr_mgr)
: ACE_Task_Base (thr_mgr)
, input_ (ior)
, corb_ (CORBA::ORB::_duplicate (corb))
{
}
int
Client_Task::svc (void)
{
try
{
CORBA::Object_var object =
corb_->string_to_object (input_);
Test_Interceptors::Visual_var server =
Test_Interceptors::Visual::_narrow (object.in ());
if (CORBA::is_nil (server.in ()))
{
ACE_ERROR_RETURN ((LM_ERROR,
"Object reference <%s> is nil\n",
this->input_),
1);
}
run_test (server.in ());
server->shutdown ();
}
catch (const CORBA::Exception& ex)
{
ex._tao_print_exception ("Exception caught in client task:");
return 1;
}
return 0;
}
void
Client_Task::run_test (Test_Interceptors::Visual_ptr server)
{
server->normal (10);
CORBA::Long one = 1, two = 1;
(void) server->calculate (one,
two);
try
{
(void) server->user ();
}
catch (const Test_Interceptors::Silly&)
{
ACE_DEBUG ((LM_DEBUG, "Caught Silly\n"));
}
try
{
server->system ();
}
catch (const CORBA::INV_OBJREF&)
{
ACE_DEBUG ((LM_DEBUG, "Caught CORBA::INV_OBJREF\n"));
}
}
|