1 //=============================================================================
5 * Implements the timeout CORBA Object and its reply handler.
7 * @author Michael Kircher <Michael.Kircher@mchp.siemens.de>
9 //=============================================================================
11 #include "timeout_i.h"
12 #include "ace/OS_NS_unistd.h"
14 Timeout_i::Timeout_i (CORBA::ORB_ptr orb
)
16 orb_
= CORBA::ORB::_duplicate (orb
);
20 Timeout_i::sendTimeToWait (CORBA::Long msec
)
22 //ACE_DEBUG ((LM_DEBUG,
23 // "Timeout_i::sendTimeToWait: invoked with msec = %d\n\n",
28 // ACE_DEBUG ((LM_DEBUG,
29 // "Timeout_i::sendTimeToWait: sleeping\n\n"));
31 ACE_Time_Value
tv (0, msec
* 1000);
37 Timeout_i::shutdown ()
40 //ACE_DEBUG ((LM_DEBUG,
41 // "Timeout_i::shutdown: shut down ORB\n\n"));
44 // Reply Handler implementation
46 TimeoutHandler_i::TimeoutHandler_i ()
48 , reply_excep_counter_ (0)
56 TimeoutHandler_i::sendTimeToWait ()
65 TimeoutHandler_i::sendTimeToWait_excep (::Messaging::ExceptionHolder
*excep_holder
)
71 excep_holder
->raise_exception ();
73 catch (const CORBA::TIMEOUT
& )
77 ++reply_excep_counter_
;
82 "Error: Unexpected exception"));
87 TimeoutHandler_i::reset_reply_counter ()
93 TimeoutHandler_i::reset_reply_excep_counter ()
95 reply_excep_counter_
= 0;
99 TimeoutHandler_i::reply_counter ()
101 return reply_counter_
;
105 TimeoutHandler_i::reply_excep_counter ()
107 return reply_excep_counter_
;
111 TimeoutHandler_i::start ()
118 TimeoutHandler_i::elapsed_time ()
120 timer_
.elapsed_time (elapsed_time_
);
121 return elapsed_time_
;