00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Asynch_Timeout_Handler.h 00006 * 00007 * $Id: Asynch_Timeout_Handler.h 82596 2008-08-11 18:01:34Z johnnyw $ 00008 * 00009 * Timeout Handler for AMI timeouts 00010 * 00011 * 00012 * @author Michael Kircher <Michael.Kircher@mchp.siemens.de> 00013 */ 00014 //============================================================================= 00015 00016 00017 #ifndef TAO_ASYNCH_TIMEOUT_HANDLER_H 00018 #define TAO_ASYNCH_TIMEOUT_HANDLER_H 00019 00020 #include /**/ "ace/pre.h" 00021 00022 #include "tao/Messaging/messaging_export.h" 00023 00024 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00025 # pragma once 00026 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00027 00028 #include "tao/orbconf.h" 00029 #include "tao/Basic_Types.h" 00030 00031 #include "ace/Event_Handler.h" 00032 00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00034 00035 class TAO_Transport_Mux_Strategy; 00036 00037 /** 00038 * @class TAO_Asynch_Timeout_Handler 00039 * 00040 * @brief Handler registered with the reactor in case of AMI timeouts. 00041 */ 00042 class TAO_Asynch_Timeout_Handler 00043 : public ACE_Event_Handler 00044 { 00045 public: 00046 TAO_Asynch_Timeout_Handler (ACE_Reactor *reactor); 00047 00048 ~TAO_Asynch_Timeout_Handler (); 00049 00050 /// Schedule a timer 00051 long schedule_timer (TAO_Transport_Mux_Strategy *tms, 00052 CORBA::ULong request_id, 00053 const ACE_Time_Value &max_wait_time); 00054 00055 /// Invoked by the reactor on timeout 00056 virtual int handle_timeout (const ACE_Time_Value ¤t_time, 00057 const void *act); 00058 00059 /// Cancel this timer, remove it from the reactor 00060 virtual void cancel (); 00061 00062 public: 00063 /// The transport mux strategy dispatching the reply 00064 TAO_Transport_Mux_Strategy *tms_; 00065 00066 /// Remember the ID of the request. 00067 CORBA::ULong request_id_; 00068 00069 /// Our reactor 00070 ACE_Reactor *reactor_; 00071 }; 00072 00073 TAO_END_VERSIONED_NAMESPACE_DECL 00074 00075 #include /**/ "ace/post.h" 00076 00077 #endif /* TAO_ASYNCH_TIMEOUT_HANDLER_H */