00001 // -*- C++ -*- 00002 00003 /** 00004 * @file ProxySupplier.h 00005 * 00006 * ProxySupplier.h,v 1.17 2006/03/14 06:14:34 jtc Exp 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 00025 #include "orbsvcs/CosEventChannelAdminC.h" 00026 00027 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00028 00029 class TAO_Notify_Consumer; 00030 class TAO_Notify_Method_Request_Dispatch_No_Copy; 00031 /** 00032 * @class TAO_Notify_ProxySupplier 00033 * 00034 * @brief Base class for all the ProxySuppliers. 00035 * 00036 */ 00037 class TAO_Notify_Serv_Export TAO_Notify_ProxySupplier : public virtual TAO_Notify_Proxy 00038 { 00039 friend class TAO_Notify_Consumer; 00040 00041 public: 00042 typedef TAO_Notify_Refcountable_Guard_T<TAO_Notify_ProxySupplier> Ptr; 00043 /// Constuctor 00044 TAO_Notify_ProxySupplier (void); 00045 00046 /// Destructor 00047 virtual ~TAO_Notify_ProxySupplier (); 00048 00049 /// Init 00050 virtual void init (TAO_Notify_ConsumerAdmin* consumer_admin ACE_ENV_ARG_DECL); 00051 00052 /// Connect 00053 void connect (TAO_Notify_Consumer* consumer ACE_ENV_ARG_DECL) 00054 ACE_THROW_SPEC (( 00055 CORBA::SystemException 00056 , CosEventChannelAdmin::AlreadyConnected 00057 )); 00058 /// Disconnect 00059 void disconnect (ACE_ENV_SINGLE_ARG_DECL); 00060 00061 /// Dispatch Event to consumer 00062 virtual void deliver (TAO_Notify_Method_Request_Dispatch_No_Copy & request ACE_ENV_ARG_DECL); 00063 00064 /// Override TAO_Notify_Container_T::shutdown method 00065 virtual int shutdown (ACE_ENV_SINGLE_ARG_DECL); 00066 00067 /// Destroy this object. 00068 virtual void destroy (ACE_ENV_SINGLE_ARG_DECL); 00069 00070 /// Override, TAO_Notify_Proxy::qos_changed to apply MaxEventssPerConsumer QoS. 00071 virtual void qos_changed (const TAO_Notify_QoSProperties& qos_properties); 00072 00073 /// Returns true if connected 00074 bool is_connected (void) const; 00075 00076 /// Access the Consumer 00077 TAO_Notify_Consumer* consumer (void); 00078 00079 /// The CA parent. 00080 TAO_Notify_ConsumerAdmin& consumer_admin (void); 00081 00082 private: 00083 ///= Data Members. 00084 /// The CA parent. 00085 TAO_Notify_ConsumerAdmin::Ptr consumer_admin_; 00086 00087 /// The Consumer that we're connect to. 00088 ACE_Auto_Ptr<TAO_Notify_Consumer> consumer_; 00089 00090 /// Access our Peer. 00091 virtual TAO_Notify_Peer* peer (void); 00092 }; 00093 00094 TAO_END_VERSIONED_NAMESPACE_DECL 00095 00096 #if defined (__ACE_INLINE__) 00097 #include "orbsvcs/Notify/ProxySupplier.inl" 00098 #endif /* __ACE_INLINE__ */ 00099 00100 #include /**/ "ace/post.h" 00101 #endif /* TAO_Notify_PROXYSUPPLIER_H */