00001 // -*- C++ -*- 00002 00003 /** 00004 * @file Method_Request_Lookup.h 00005 * 00006 * Method_Request_Lookup.h,v 1.17 2006/03/14 06:14:34 jtc Exp 00007 * 00008 * @author Pradeep Gore <pradeep@oomworks.com> 00009 */ 00010 #ifndef TAO_Notify_LOOKUP_METHOD_REQUEST_H 00011 #define TAO_Notify_LOOKUP_METHOD_REQUEST_H 00012 #include /**/ "ace/pre.h" 00013 00014 #include "orbsvcs/Notify/notify_serv_export.h" 00015 00016 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00017 # pragma once 00018 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00019 00020 #include "orbsvcs/ESF/ESF_Worker.h" 00021 #include "orbsvcs/Notify/Method_Request_Event.h" 00022 #include "orbsvcs/Notify/ProxySupplier.h" 00023 #include "orbsvcs/Notify/ProxyConsumer.h" 00024 #include "orbsvcs/Notify/Consumer_Map.h" 00025 #include "orbsvcs/Notify/Delivery_Request.h" 00026 00027 #include "orbsvcs/ESF/ESF_Worker.h" 00028 00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00030 00031 class TAO_Notify_Method_Request_Lookup_Queueable; 00032 class TAO_Notify_Event; 00033 00034 /** 00035 * @class TAO_Notify_Method_Request_Lookup 00036 * 00037 * @brief 00038 * 00039 */ 00040 class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Lookup 00041 : public TAO_ESF_Worker<TAO_Notify_ProxySupplier> 00042 , public TAO_Notify_Method_Request_Event 00043 { 00044 public: 00045 00046 /// an arbitrary code (Octet) to identify this type of request in persistent storage 00047 enum {persistence_code = 2}; 00048 00049 /// Destructor 00050 virtual ~TAO_Notify_Method_Request_Lookup (); 00051 00052 /// Static method used to reconstruct a Method Request Dispatch 00053 static TAO_Notify_Method_Request_Lookup_Queueable * unmarshal ( 00054 TAO_Notify::Delivery_Request_Ptr & delivery_request, 00055 TAO_Notify_EventChannelFactory &ecf, 00056 TAO_InputCDR & cdr 00057 ACE_ENV_ARG_DECL); 00058 00059 protected: 00060 /// Constuctor 00061 TAO_Notify_Method_Request_Lookup (const TAO_Notify_Event * event, TAO_Notify_ProxyConsumer * proxy); 00062 00063 /// Execute the dispatch operation. 00064 int execute_i (ACE_ENV_SINGLE_ARG_DECL); 00065 00066 ///= TAO_ESF_Worker method 00067 virtual void work (TAO_Notify_ProxySupplier* proxy_supplier ACE_ENV_ARG_DECL); 00068 00069 protected: 00070 00071 /// The Proxy 00072 TAO_Notify_ProxyConsumer* proxy_consumer_; 00073 }; 00074 00075 /***************************************************************/ 00076 00077 /** 00078 * @class TAO_Notify_Method_Request_Lookup_Queueable 00079 * 00080 * @brief Lookup command object looks up the event type of the given event in the consumer map and send the event to each proxysupplier. 00081 * 00082 */ 00083 class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Lookup_Queueable 00084 : public TAO_Notify_Method_Request_Lookup 00085 , public TAO_Notify_Method_Request_Queueable 00086 { 00087 public: 00088 /// Constuctor from event 00089 TAO_Notify_Method_Request_Lookup_Queueable ( 00090 const TAO_Notify_Event::Ptr& event, 00091 TAO_Notify_ProxyConsumer * proxy_consumer); 00092 00093 /// Constuctor from delivery request 00094 TAO_Notify_Method_Request_Lookup_Queueable ( 00095 TAO_Notify::Delivery_Request_Ptr & request, 00096 TAO_Notify_ProxyConsumer * proxy_consumer); 00097 00098 /// Destructor 00099 virtual ~TAO_Notify_Method_Request_Lookup_Queueable (); 00100 00101 /// Execute the Request 00102 virtual int execute (ACE_ENV_SINGLE_ARG_DECL); 00103 00104 private: 00105 TAO_Notify_Event::Ptr event_var_; 00106 TAO_Notify_ProxyConsumer::Ptr proxy_guard_; 00107 }; 00108 00109 /*****************************************************************************************************************************/ 00110 00111 /** 00112 * @class TAO_Notify_Method_Request_Lookup_No_Copy 00113 * 00114 * @brief Lookup command object looks up the event type of the given event in the consumer map and send the event to each proxysupplier. 00115 * 00116 */ 00117 class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Lookup_No_Copy 00118 : public TAO_Notify_Method_Request_Lookup 00119 , public TAO_Notify_Method_Request 00120 { 00121 public: 00122 /// Constuctor 00123 TAO_Notify_Method_Request_Lookup_No_Copy ( 00124 const TAO_Notify_Event* event, 00125 TAO_Notify_ProxyConsumer* proxy_consumer); 00126 00127 /// Destructor 00128 virtual ~TAO_Notify_Method_Request_Lookup_No_Copy (); 00129 00130 /// Execute the Request 00131 virtual int execute (ACE_ENV_SINGLE_ARG_DECL); 00132 00133 /// Create a copy of this object. 00134 virtual TAO_Notify_Method_Request_Queueable* copy (ACE_ENV_SINGLE_ARG_DECL); 00135 }; 00136 00137 TAO_END_VERSIONED_NAMESPACE_DECL 00138 00139 #include /**/ "ace/post.h" 00140 #endif /* TAO_Notify_LOOKUP_METHOD_REQUEST_H */