00001 // -*- C++ -*- 00002 00003 /** 00004 * @file ProxySupplier.h 00005 * 00006 * $Id: ProxySupplier.h 84685 2009-03-02 22:49:17Z mesnier_p $ 00007 * 00008 * @author Pradeep Gore <pradeep@oomworks.com> 00009 */ 00010 00011 #ifndef TAO_Notify_PROXYSUPPLIER_H 00012 #define TAO_Notify_PROXYSUPPLIER_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/Event.h" 00022 #include "orbsvcs/Notify/Proxy.h" 00023 #include "orbsvcs/Notify/ConsumerAdmin.h" 00024 #include "orbsvcs/Notify/Consumer.h" 00025 00026 #include "orbsvcs/CosEventChannelAdminC.h" 00027 00028 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00029 00030 class TAO_Notify_Consumer; 00031 class TAO_Notify_Method_Request_Dispatch_No_Copy; 00032 /** 00033 * @class TAO_Notify_ProxySupplier 00034 * 00035 * @brief Base class for all the ProxySuppliers. 00036 * 00037 */ 00038 class TAO_Notify_Serv_Export TAO_Notify_ProxySupplier : public virtual TAO_Notify_Proxy 00039 { 00040 friend class TAO_Notify_Consumer; 00041 00042 public: 00043 typedef TAO_Notify_Refcountable_Guard_T<TAO_Notify_ProxySupplier> Ptr; 00044 /// Constructor 00045 TAO_Notify_ProxySupplier (void); 00046 00047 /// Destructor 00048 virtual ~TAO_Notify_ProxySupplier (); 00049 00050 /// Init 00051 virtual void init (TAO_Notify_ConsumerAdmin* consumer_admin); 00052 00053 /// Connect 00054 void connect (TAO_Notify_Consumer* consumer); 00055 /// Disconnect 00056 void disconnect (void); 00057 00058 /// Dispatch Event to consumer 00059 virtual void deliver (TAO_Notify_Method_Request_Dispatch_No_Copy & request); 00060 00061 /// Override TAO_Notify_Container_T::shutdown method 00062 virtual int shutdown (void); 00063 00064 /// Destroy this object. 00065 virtual void destroy (void); 00066 00067 /// Destroy this object, but also indicate if it is due to a timeout or 00068 /// not. 00069 void destroy (bool from_timeout); 00070 00071 /// Override, TAO_Notify_Proxy::qos_changed to apply MaxEventssPerConsumer QoS. 00072 virtual void qos_changed (const TAO_Notify_QoSProperties& qos_properties); 00073 00074 /// Returns true if connected 00075 bool is_connected (void) const; 00076 00077 /// Access the Consumer 00078 TAO_Notify_Consumer* consumer (void); 00079 00080 /// The CA parent. 00081 TAO_Notify_ConsumerAdmin& consumer_admin (void); 00082 00083 private: 00084 ///= Data Members. 00085 /// The CA parent. 00086 TAO_Notify_ConsumerAdmin::Ptr consumer_admin_; 00087 00088 /// The Consumer that we're connect to. 00089 TAO_Notify_Consumer::Ptr consumer_; 00090 00091 /// Access our Peer. 00092 virtual TAO_Notify_Peer* peer (void); 00093 }; 00094 00095 TAO_END_VERSIONED_NAMESPACE_DECL 00096 00097 #if defined (__ACE_INLINE__) 00098 #include "orbsvcs/Notify/ProxySupplier.inl" 00099 #endif /* __ACE_INLINE__ */ 00100 00101 #include /**/ "ace/post.h" 00102 #endif /* TAO_Notify_PROXYSUPPLIER_H */