blob: de2f9ef1f51240471e1cff4796f127c316430727 (
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
|
#include "Push_Handler.h"
#include "tao/debug.h"
ACE_RCSID (LoadBalancing,
Push_Handler,
"$Id$")
TAO_LB_Push_Handler::TAO_LB_Push_Handler (
CosLoadBalancing::LoadMonitor_ptr monitor,
const PortableGroup::Location & location,
CosLoadBalancing::LoadManager_ptr manager)
: monitor_ (CosLoadBalancing::LoadMonitor::_duplicate (monitor)),
location_ (location),
manager_ (CosLoadBalancing::LoadManager::_duplicate (manager))
{
}
int
TAO_LB_Push_Handler::handle_timeout (
const ACE_Time_Value & /* current_time */,
const void * /* arg */)
{
ACE_DECLARE_NEW_CORBA_ENV;
ACE_TRY
{
CosLoadBalancing::LoadList_var loads =
this->monitor_->loads (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
// ACE_DEBUG ((LM_DEBUG,
// "PUSHING LOAD:\n"
// " id: %u\n"
// " value: %f\n",
// loads[0].id,
// loads[0].value));
this->manager_->push_loads (this->location_,
loads.in ()
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
}
ACE_CATCHANY
{
// Catch the exception and ignore it.
// @@ Yah?
if (TAO_debug_level > 0)
ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
"(%P|%t) Push_Handler::handle_timeout()\n");
}
ACE_ENDTRY;
return 0;
}
|