00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file DII_Reply_Dispatcher.h 00006 * 00007 * $Id: DII_Reply_Dispatcher.h 78165 2007-04-24 09:25:23Z johnnyw $ 00008 * 00009 * @brief Dispatch the reply appropriately. 00010 * 00011 * @author Alexander Babu Arulanthu <alex@cs.wustl.edu> 00012 */ 00013 00014 #ifndef TAO_DII_REPLY_DISPATCHER_H 00015 #define TAO_DII_REPLY_DISPATCHER_H 00016 00017 #include /**/ "ace/pre.h" 00018 00019 #include "tao/DynamicInterface/dynamicinterface_export.h" 00020 00021 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00022 # pragma once 00023 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00024 00025 #include "tao/orbconf.h" 00026 #include "tao/Asynch_Reply_Dispatcher_Base.h" 00027 00028 #if defined (TAO_HAS_AMI) 00029 #include "tao/Messaging/Messaging.h" 00030 #endif /* TAO_HAS_AMI */ 00031 00032 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00033 00034 namespace CORBA 00035 { 00036 class Request; 00037 typedef Request *Request_ptr; 00038 } 00039 00040 class TAO_ORB_Core; 00041 00042 /** 00043 * @class TAO_DII_Deferred_Reply_Dispatcher 00044 * 00045 * @brief Reply dispatcher for DII deferred requests. 00046 */ 00047 class TAO_DynamicInterface_Export TAO_DII_Deferred_Reply_Dispatcher 00048 : public TAO_Asynch_Reply_Dispatcher_Base 00049 { 00050 public: 00051 TAO_DII_Deferred_Reply_Dispatcher (const CORBA::Request_ptr req, 00052 TAO_ORB_Core *orb_core); 00053 00054 00055 00056 /// The Reply_Dispatcher methods 00057 virtual int dispatch_reply (TAO_Pluggable_Reply_Params ¶m); 00058 00059 virtual void connection_closed (void); 00060 00061 /// The following methods are not needed for this class.. 00062 virtual void reply_timed_out (void) {} 00063 virtual long schedule_timer (CORBA::ULong , const ACE_Time_Value &) 00064 { 00065 return 0; 00066 } 00067 00068 protected: 00069 /// Destructor. 00070 ~TAO_DII_Deferred_Reply_Dispatcher (void); 00071 00072 private: 00073 /// Where the reply needs to go. 00074 const CORBA::Request_ptr req_; 00075 }; 00076 00077 #if defined (TAO_HAS_AMI) 00078 /** 00079 * @class TAO_DII_Asynch_Reply_Dispatcher 00080 * 00081 * @brief Reply dispatcher for DII asynch requests. 00082 */ 00083 class TAO_DynamicInterface_Export TAO_DII_Asynch_Reply_Dispatcher 00084 : public TAO_Asynch_Reply_Dispatcher_Base 00085 { 00086 public: 00087 TAO_DII_Asynch_Reply_Dispatcher (const Messaging::ReplyHandler_ptr callback, 00088 TAO_ORB_Core *orb_core); 00089 virtual ~TAO_DII_Asynch_Reply_Dispatcher (void); 00090 00091 /// The Reply_Dispatcher methods 00092 virtual int dispatch_reply (TAO_Pluggable_Reply_Params ¶m); 00093 00094 virtual void connection_closed (void); 00095 00096 private: 00097 00098 /// The buffer that is used to initialise the data block 00099 char buf_[ACE_CDR::DEFAULT_BUFSIZE]; 00100 00101 /// Datablock that is created on the stack to initialise the CDR 00102 /// stream underneath. 00103 ACE_Data_Block db_; 00104 00105 /// CDR stream for reading the input. 00106 TAO_InputCDR reply_cdr_; 00107 00108 /// Where the reply needs to go. 00109 const Messaging::ReplyHandler_ptr callback_; 00110 }; 00111 #endif /* TAO_HAS_AMI */ 00112 00113 TAO_END_VERSIONED_NAMESPACE_DECL 00114 00115 #include /**/ "ace/post.h" 00116 00117 #endif /* TAO_REPLY_DISPATCHER_H */