00001 // -*- C++ -*- 00002 00003 /** 00004 * @file ESF_Peer_Admin.h 00005 * 00006 * ESF_Peer_Admin.h,v 1.12 2006/03/15 07:52:21 jtc Exp 00007 * 00008 * @author Carlos O'Ryan (coryan@cs.wustl.edu) 00009 * 00010 * http://doc.ece.uci.edu/~coryan/EC/index.html 00011 */ 00012 00013 #ifndef TAO_ESF_PEER_ADMIN_H 00014 #define TAO_ESF_PEER_ADMIN_H 00015 00016 #include "orbsvcs/ESF/ESF_Proxy_Admin.h" 00017 00018 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00019 # pragma once 00020 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00021 00022 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00023 00024 /** 00025 * @class TAO_ESF_Peer_Admin 00026 * 00027 * @brief Extend the Proxy_Admin interface to provide methods for 00028 * filtering 00029 * 00030 * Some Event Services that perform filtering have to propagate 00031 * the consumer connect/disconnect activities to the suppliers, 00032 * and vice-versa. 00033 * In that scenario the ESF_Proxy_Admin<> interface is augmented 00034 * with connected()/reconnected()/disconnected() operations for 00035 * the proxy peers (i.e. the ProxySuppliers for the ProxyConsumers 00036 * and vice-versa). 00037 * 00038 * <H2>Requirements</H2> 00039 * 00040 * In addition to the requirements imposed by ESF_Proxy_Admin<> 00041 * the PROXY interface must implement: 00042 * 00043 * @verbatim 00044 * void connected (PEER *peer ACE_ENV_ARG_DECL_NOT_USED) throw (); 00045 * void reconnected (PEER *peer ACE_ENV_ARG_DECL_NOT_USED) throw (); 00046 * void disconnected (PEER *peer ACE_ENV_ARG_DECL_NOT_USED) throw (); 00047 * @endverbatim 00048 * 00049 * Similarly, the PEER interface must implement: 00050 * 00051 * @verbatim 00052 * void connected (PROXY *proxy ACE_ENV_ARG_DECL_NOT_USED) throw (); 00053 * void reconnected (PROXY *proxy ACE_ENV_ARG_DECL_NOT_USED) throw (); 00054 * void disconnected (PROXY *proxy ACE_ENV_ARG_DECL_NOT_USED) throw (); 00055 * @endverbatim 00056 */ 00057 template<class EVENT_CHANNEL, class PROXY, class INTERFACE, class PEER> 00058 class TAO_ESF_Peer_Admin : public TAO_ESF_Proxy_Admin<EVENT_CHANNEL,PROXY,INTERFACE> 00059 { 00060 public: 00061 /// Constructor 00062 TAO_ESF_Peer_Admin (EVENT_CHANNEL *ec); 00063 00064 /// destructor 00065 virtual ~TAO_ESF_Peer_Admin (void); 00066 00067 /** 00068 * A <peer> has connected, this is invoked when the peer's client 00069 * has invoked the connect_xxx_yyy() method. 00070 * The default implementation is a no-op. 00071 */ 00072 virtual void peer_connected (PEER *peer 00073 ACE_ENV_ARG_DECL) 00074 ACE_THROW_SPEC ((CORBA::SystemException)); 00075 00076 /** 00077 * A <peer> has reconnected, i.e. its client has invoked the 00078 * connect_xxx_yyy() method, but the peer was connected already. 00079 * The default implementation delegates on the collection 00080 * <reconnected> method 00081 */ 00082 virtual void peer_reconnected (PEER *peer 00083 ACE_ENV_ARG_DECL) 00084 ACE_THROW_SPEC ((CORBA::SystemException)); 00085 00086 /** 00087 * A <peer> has been disconnected. The default implementation 00088 * removes the object from the collection and deactivates the 00089 * proxy. 00090 */ 00091 virtual void peer_disconnected (PEER *peer 00092 ACE_ENV_ARG_DECL) 00093 ACE_THROW_SPEC ((CORBA::SystemException)); 00094 }; 00095 00096 // **************************************************************** 00097 00098 TAO_END_VERSIONED_NAMESPACE_DECL 00099 00100 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) 00101 #include "orbsvcs/ESF/ESF_Peer_Admin.cpp" 00102 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ 00103 00104 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) 00105 #pragma implementation ("ESF_Peer_Admin.cpp") 00106 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ 00107 00108 #endif /* TAO_ESF_PEER_ADMIN_H */