00001 // This may look like C, but it's really -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Asynch_Reply_Dispatcher.h 00006 * 00007 * $Id: Asynch_Reply_Dispatcher.h 82876 2008-09-29 15:02:02Z johnnyw $ 00008 * 00009 * @author Alexander Babu Arulanthu <alex@cs.wustl.edu> 00010 * @author Jeff Parsons <parsons@cs.wustl.edu> 00011 */ 00012 //============================================================================= 00013 00014 00015 #ifndef TAO_ASYNCH_REPLY_DISPATCHER_H 00016 #define TAO_ASYNCH_REPLY_DISPATCHER_H 00017 #include /**/ "ace/pre.h" 00018 00019 #include "tao/Messaging/Messaging.h" 00020 00021 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00022 # pragma once 00023 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00024 00025 #include "tao/Messaging/Asynch_Timeout_Handler.h" 00026 #include "tao/Asynch_Reply_Dispatcher_Base.h" 00027 00028 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00029 class ACE_Allocator; 00030 ACE_END_VERSIONED_NAMESPACE_DECL 00031 00032 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00033 00034 /// Reply dispatcher for Asynchoronous Method Invocation (AMI)s. 00035 class TAO_Asynch_Reply_Dispatcher 00036 : public TAO_Asynch_Reply_Dispatcher_Base 00037 { 00038 public: 00039 /// Constructor. 00040 TAO_Asynch_Reply_Dispatcher ( 00041 const TAO_Reply_Handler_Stub &reply_handler_stub, 00042 Messaging::ReplyHandler_ptr reply_handler_ptr, 00043 TAO_ORB_Core *orb_core, 00044 ACE_Allocator *allocator); 00045 00046 /// Destructor. 00047 virtual ~TAO_Asynch_Reply_Dispatcher (void); 00048 00049 /// @name The Reply Dispatcher methods 00050 //@{ 00051 virtual int dispatch_reply (TAO_Pluggable_Reply_Params ¶ms); 00052 00053 virtual void connection_closed (void); 00054 //@} 00055 00056 /// Inform that the reply timed out 00057 virtual void reply_timed_out (void); 00058 00059 /// Install the timeout handler 00060 long schedule_timer (CORBA::ULong request_id, 00061 const ACE_Time_Value &max_wait_time); 00062 00063 private: 00064 /// Stub for the call back method in the Reply Handler. 00065 TAO_Reply_Handler_Stub const reply_handler_stub_; 00066 00067 /// Reply Handler passed in the Asynchronous Invocation. 00068 Messaging::ReplyHandler_var reply_handler_; 00069 00070 /// Timeout Handler in case of AMI timeouts 00071 TAO_Asynch_Timeout_Handler *timeout_handler_; 00072 }; 00073 00074 TAO_END_VERSIONED_NAMESPACE_DECL 00075 00076 #include /**/ "ace/post.h" 00077 #endif /* TAO_ASYNCH_REPLY_DISPATCHER_H */