blob: d26dc48d8821d757bc8df21ffbf7965288edee36 (
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
|
#include "orbsvcs/Log/Iterator_i.h"
ACE_RCSID (Log,
Iterator_i,
"$Id$")
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
// iterator inactivity timeout
ACE_Time_Value
TAO_Iterator_i::timeout_(60 * 60);
TAO_Iterator_i::TAO_Iterator_i (ACE_Reactor* reactor)
: reactor_ (reactor)
{
if (this->timeout_ != ACE_Time_Value::zero)
{
this->timer_id_ =
this->reactor_->schedule_timer (this, 0, this->timeout_);
}
}
TAO_Iterator_i::~TAO_Iterator_i (void)
{
// cancel timer
if (this->timer_id_ != -1)
{
this->reactor_->cancel_timer (this->timer_id_);
}
}
void
TAO_Iterator_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
PortableServer::POA_ptr poa =
this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
PortableServer::ObjectId_var oid =
poa->servant_to_id (this
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
// Goodbye cruel world...
// deactivate from the poa.
poa->deactivate_object (oid.in ()
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
return;
}
int
TAO_Iterator_i::handle_timeout(const ACE_Time_Value&, const void*)
{
ACE_TRY_NEW_ENV
{
this->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
}
ACE_CATCHANY
{
}
ACE_ENDTRY;
return 0;
}
TAO_END_VERSIONED_NAMESPACE_DECL
|