00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file DII_Reply_Dispatcher.h 00006 * 00007 * $Id: DII_Reply_Dispatcher.h 84831 2009-03-16 08:53:54Z 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 /// The Reply_Dispatcher methods 00055 virtual int dispatch_reply (TAO_Pluggable_Reply_Params ¶m); 00056 00057 virtual void connection_closed (void); 00058 00059 /// The following methods are not needed for this class.. 00060 virtual void reply_timed_out (void) {} 00061 virtual long schedule_timer (CORBA::ULong , const ACE_Time_Value &) 00062 { 00063 return 0; 00064 } 00065 00066 protected: 00067 /// Destructor. 00068 ~TAO_DII_Deferred_Reply_Dispatcher (void); 00069 00070 private: 00071 /// Where the reply needs to go. 00072 const CORBA::Request_ptr req_; 00073 }; 00074 00075 #if defined (TAO_HAS_AMI) 00076 /** 00077 * @class TAO_DII_Asynch_Reply_Dispatcher 00078 * 00079 * @brief Reply dispatcher for DII asynch requests. 00080 */ 00081 class TAO_DynamicInterface_Export TAO_DII_Asynch_Reply_Dispatcher 00082 : public TAO_Asynch_Reply_Dispatcher_Base 00083 { 00084 public: 00085 TAO_DII_Asynch_Reply_Dispatcher (const Messaging::ReplyHandler_ptr callback, 00086 TAO_ORB_Core *orb_core); 00087 virtual ~TAO_DII_Asynch_Reply_Dispatcher (void); 00088 00089 /// The Reply_Dispatcher methods 00090 virtual int dispatch_reply (TAO_Pluggable_Reply_Params ¶m); 00091 00092 virtual void connection_closed (void); 00093 00094 private: 00095 00096 /// The buffer that is used to initialise the data block 00097 char buf_[ACE_CDR::DEFAULT_BUFSIZE]; 00098 00099 /// Datablock that is created on the stack to initialise the CDR 00100 /// stream underneath. 00101 ACE_Data_Block db_; 00102 00103 /// CDR stream for reading the input. 00104 TAO_InputCDR reply_cdr_; 00105 00106 /// Where the reply needs to go. 00107 const Messaging::ReplyHandler_ptr callback_; 00108 }; 00109 #endif /* TAO_HAS_AMI */ 00110 00111 TAO_END_VERSIONED_NAMESPACE_DECL 00112 00113 #include /**/ "ace/post.h" 00114 00115 #endif /* TAO_REPLY_DISPATCHER_H */