00001 // -*- C++ -*- 00002 00003 /** 00004 * @file Peer.h 00005 * 00006 * $Id: Peer.h 81422 2008-04-24 12:33:29Z johnnyw $ 00007 * 00008 * @author Pradeep Gore <pradeep@oomworks.com> 00009 */ 00010 00011 #ifndef TAO_Notify_PEER_H 00012 #define TAO_Notify_PEER_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/CosNotificationC.h" 00022 #include "orbsvcs/Notify/EventTypeSeq.h" 00023 00024 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00025 00026 class TAO_Notify_Proxy; 00027 class TAO_Notify_QoSProperties; 00028 class TAO_Notify_Peer; 00029 00030 /** 00031 * @class TAO_Notify_Peer 00032 * 00033 * @brief Base class for Supplier and Consumer classes. 00034 * This object delegates its reference count to its creator proxy object. 00035 * 00036 */ 00037 class TAO_Notify_Serv_Export TAO_Notify_Peer 00038 { 00039 public: 00040 typedef TAO_Notify_Refcountable_Guard_T< TAO_Notify_Peer > Ptr; 00041 /// Constructor 00042 TAO_Notify_Peer (void); 00043 00044 /// Destructor 00045 virtual ~TAO_Notify_Peer (); 00046 00047 /// This method sigantures deliberately match the RefCounting methods 00048 /// required for ESF Proxy 00049 CORBA::ULong _incr_refcnt (void); 00050 CORBA::ULong _decr_refcnt (void); 00051 00052 /// Shutdown the peer. 00053 virtual void shutdown (void); 00054 00055 /// Access Proxy. 00056 virtual TAO_Notify_Proxy* proxy (void) = 0; 00057 00058 // Dispatch updates 00059 virtual void dispatch_updates (const TAO_Notify_EventTypeSeq & added, 00060 const TAO_Notify_EventTypeSeq & removed); 00061 00062 /// QoS changed notification from the Peer. 00063 virtual void qos_changed (const TAO_Notify_QoSProperties& qos_properties); 00064 00065 /// Handle dispatch exceptions. 00066 void handle_dispatch_exception (void); 00067 00068 /// Retrieve the ior of this peer 00069 virtual ACE_CString get_ior (void) const = 0; 00070 00071 protected: 00072 /// Implementation of Peer specific dispatch_updates 00073 virtual void dispatch_updates_i (const CosNotification::EventTypeSeq& added, 00074 const CosNotification::EventTypeSeq& removed) = 0; 00075 00076 private: 00077 /// Release 00078 virtual void release (void) = 0; 00079 }; 00080 00081 TAO_END_VERSIONED_NAMESPACE_DECL 00082 00083 #include /**/ "ace/post.h" 00084 #endif /* TAO_Notify_PEER_H */