Method_Request_Dispatch.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 /**
00004  *  @file Method_Request_Dispatch.h
00005  *
00006  *  Method_Request_Dispatch.h,v 1.14 2006/03/14 06:14:34 jtc Exp
00007  *
00008  *  @author Pradeep Gore <pradeep@oomworks.com>
00009  */
00010 
00011 #ifndef TAO_Notify_DISPATCH_METHOD_REQUEST_H
00012 #define TAO_Notify_DISPATCH_METHOD_REQUEST_H
00013 #include /**/ "ace/pre.h"
00014 
00015 #include "orbsvcs/Notify/notify_serv_export.h"
00016 
00017 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00018 # pragma once
00019 #endif /* ACE_LACKS_PRAGMA_ONCE */
00020 
00021 #include "orbsvcs/Notify/Method_Request.h"
00022 #include "orbsvcs/Notify/Refcountable.h"
00023 #include "orbsvcs/Notify/Method_Request_Event.h"
00024 #include "orbsvcs/Notify/ProxySupplier.h"
00025 #include "orbsvcs/Notify/Delivery_Request.h"
00026 
00027 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00028 
00029 class TAO_Notify_EventChannelFactory;
00030 class TAO_InputCDR;
00031 class TAO_Notify_Method_Request_Dispatch_Queueable;
00032 
00033 /**
00034  * @class TAO_Notify_Method_Request_Dispatch
00035  *
00036  * @brief
00037  *
00038  */
00039 class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Dispatch
00040   : public TAO_Notify_Method_Request_Event
00041 {
00042 public:
00043   /// an arbitrary code (Octet) to identify this delivery method type in persistent storage
00044   enum {persistence_code = 1};
00045 
00046   /// Constuct from event
00047   TAO_Notify_Method_Request_Dispatch (
00048     const TAO_Notify_Event * event,
00049     TAO_Notify_ProxySupplier* proxy_supplier,
00050     bool filtering);
00051 
00052   /// Construct from a delivery rquest
00053   TAO_Notify_Method_Request_Dispatch (
00054     const TAO_Notify::Delivery_Request_Ptr & delivery,
00055     TAO_Notify_ProxySupplier* proxy_supplier,
00056     bool filtering);
00057 
00058   /// Constuct construct from another method request+event
00059   /// event is passed separately because we may be using a copy
00060   /// of the one in the previous method request
00061   TAO_Notify_Method_Request_Dispatch (
00062     const TAO_Notify_Method_Request_Event & request,
00063     const TAO_Notify_Event * event,
00064     TAO_Notify_ProxySupplier* proxy_supplier,
00065     bool filtering);
00066 
00067 public:
00068   /// Destructor
00069   virtual ~TAO_Notify_Method_Request_Dispatch ();
00070 
00071   /// Static method used to reconstruct a Method Request Dispatch
00072   static TAO_Notify_Method_Request_Dispatch_Queueable * unmarshal (
00073     TAO_Notify::Delivery_Request_Ptr & delivery_request,
00074     TAO_Notify_EventChannelFactory &ecf,
00075     TAO_InputCDR & cdr
00076     ACE_ENV_ARG_DECL);
00077 
00078 
00079 protected:
00080   /// Execute the dispatch operation.
00081   int execute_i (ACE_ENV_SINGLE_ARG_DECL);
00082 
00083 protected:
00084   /// The Proxy
00085   TAO_Notify_ProxySupplier::Ptr proxy_supplier_;
00086 
00087   /// Flag is true if we want to do filtering else false.
00088   bool filtering_;
00089 };
00090 
00091 /**
00092  * @class TAO_Notify_Method_Request_Dispatch_Queueable
00093  *
00094  * @brief Dispatchs an event to a proxy supplier.
00095  *
00096  */
00097 
00098 class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Dispatch_Queueable
00099     : public TAO_Notify_Method_Request_Dispatch
00100     , public TAO_Notify_Method_Request_Queueable
00101 {
00102 public:
00103   /// Construct construct from another method request+event
00104   /// event is passed separately because we may be using a copy
00105   /// of the one in the previous method request
00106   TAO_Notify_Method_Request_Dispatch_Queueable (
00107     const TAO_Notify_Method_Request_Event & request,
00108     TAO_Notify_Event::Ptr & event,
00109     TAO_Notify_ProxySupplier* proxy_supplier,
00110     bool filtering);
00111 
00112   /// Constuct construct from Delivery Request
00113   /// should ONLY be used by unmarshall
00114   TAO_Notify_Method_Request_Dispatch_Queueable (
00115     const TAO_Notify::Delivery_Request_Ptr & request,
00116     TAO_Notify_ProxySupplier* proxy_supplier,
00117     bool filtering);
00118 
00119   /// Destructor
00120   virtual ~TAO_Notify_Method_Request_Dispatch_Queueable ();
00121 
00122   /// Execute the Request
00123   virtual int execute (ACE_ENV_SINGLE_ARG_DECL);
00124 
00125 private:
00126   TAO_Notify_Event::Ptr event_var_;
00127   TAO_Notify_ProxySupplier::Ptr proxy_guard_;
00128 };
00129 
00130 /*****************************************************************************/
00131 
00132 /**
00133  * @class TAO_Notify_Method_Request_Dispatch_No_Copy
00134  *
00135  * @brief Dispatchs an event to a proxy supplier.
00136  *
00137  */
00138 class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Dispatch_No_Copy
00139     : public TAO_Notify_Method_Request_Dispatch
00140     , public TAO_Notify_Method_Request
00141 {
00142 public:
00143   /// Constuct from event
00144   TAO_Notify_Method_Request_Dispatch_No_Copy (
00145     const TAO_Notify_Event * event,
00146     TAO_Notify_ProxySupplier* proxy_supplier,
00147     bool filtering);
00148 
00149   /// Constuct construct from another method request
00150   TAO_Notify_Method_Request_Dispatch_No_Copy (
00151     const TAO_Notify_Method_Request_Event & request,
00152     TAO_Notify_ProxySupplier* proxy_supplier,
00153     bool filtering);
00154 
00155   /// Destructor
00156   virtual ~TAO_Notify_Method_Request_Dispatch_No_Copy ();
00157 
00158   /// Execute the Request
00159   virtual int execute (ACE_ENV_SINGLE_ARG_DECL);
00160 
00161   /// Create a copy of this method request
00162   virtual TAO_Notify_Method_Request_Queueable* copy (ACE_ENV_SINGLE_ARG_DECL);
00163 };
00164 
00165 /*****************************************************************************/
00166 
00167 TAO_END_VERSIONED_NAMESPACE_DECL
00168 
00169 #include /**/ "ace/post.h"
00170 #endif /* TAO_Notify_DISPATCH_METHOD_REQUEST_H */

Generated on Thu Nov 9 13:24:12 2006 for TAO_CosNotification by doxygen 1.3.6