00001 /* -*- C++ -*- */ 00002 /** 00003 * @file Admin.h 00004 * 00005 * $Id: Admin.h 81422 2008-04-24 12:33:29Z johnnyw $ 00006 * 00007 * @author Pradeep Gore <pradeep@oomworks.com> 00008 * 00009 * 00010 */ 00011 00012 #ifndef TAO_Notify_ADMIN_H 00013 #define TAO_Notify_ADMIN_H 00014 00015 #include /**/ "ace/pre.h" 00016 00017 #include "orbsvcs/Notify/notify_serv_export.h" 00018 00019 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00020 # pragma once 00021 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00022 00023 #include "orbsvcs/Notify/FilterAdmin.h" 00024 #include "orbsvcs/Notify/EventTypeSeq.h" 00025 #include "orbsvcs/Notify/Topology_Object.h" 00026 #include "orbsvcs/Notify/EventChannel.h" 00027 00028 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00029 00030 class TAO_Notify_Proxy; 00031 template <class TYPE> class TAO_Notify_Container_T; 00032 00033 /** 00034 * @class TAO_Notify_Admin 00035 * 00036 * @brief Base class for the ConsumerAdmin and SupplierAdmin. 00037 * 00038 */ 00039 00040 class TAO_Notify_Serv_Export TAO_Notify_Admin : public TAO_Notify::Topology_Parent 00041 { 00042 friend class TAO_Notify_Builder; 00043 public: 00044 typedef CosNotifyChannelAdmin::AdminIDSeq SEQ; 00045 typedef CosNotifyChannelAdmin::AdminIDSeq_var SEQ_VAR; 00046 00047 /// Constructor 00048 TAO_Notify_Admin (); 00049 00050 /// Destructor 00051 virtual ~TAO_Notify_Admin (); 00052 00053 /// Init 00054 void init (TAO_Notify::Topology_Parent * parent); 00055 00056 /// Insert the proxy in the <proxy_container_>. 00057 void insert (TAO_Notify_Proxy* proxy); 00058 00059 /// Remove type from container_ and cleanup any EC resources. 00060 void cleanup_proxy (TAO_Notify_Proxy *proxy, bool is_supplier); 00061 00062 /// Access Admin FilterAdmin. 00063 TAO_Notify_FilterAdmin& filter_admin (void); 00064 00065 /// Set Filter operator 00066 void filter_operator ( 00067 CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator); 00068 00069 /// Access Filter operator 00070 CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator (void); 00071 00072 /// Obtain the Admin's subscribed types. 00073 void subscribed_types (TAO_Notify_EventTypeSeq& subscribed_types); 00074 00075 TAO_Notify_EventChannel * event_channel () const; 00076 00077 /// Shutdown 00078 virtual int shutdown (void); 00079 00080 virtual void save_persistent (TAO_Notify::Topology_Saver& saver); 00081 virtual TAO_Notify::Topology_Object* load_child (const ACE_CString &type, 00082 CORBA::Long id, const TAO_Notify::NVPList& attrs); 00083 virtual void reconnect (void); 00084 00085 void set_default (bool is_default); 00086 bool is_default () const; 00087 virtual void load_attrs(const TAO_Notify::NVPList& attrs); 00088 00089 protected: 00090 void save_attrs (TAO_Notify::NVPList& attrs); 00091 virtual const char * get_admin_type_name (void) const = 0; 00092 00093 typedef TAO_Notify_Container_T<TAO_Notify_Proxy> TAO_Notify_Proxy_Container; 00094 00095 TAO_Notify_Proxy_Container& proxy_container(); 00096 /// = Data Members 00097 00098 /// The EventChannel. 00099 TAO_Notify_EventChannel::Ptr ec_; 00100 00101 /// The types that we've subscribed our proxy objects with the event manager. 00102 TAO_Notify_EventTypeSeq subscribed_types_; 00103 00104 /// Filter Administration 00105 TAO_Notify_FilterAdmin filter_admin_; 00106 00107 /// Filter operator 00108 CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator_; 00109 00110 bool is_default_; 00111 private: 00112 /// Remove type from container_ 00113 void remove (TAO_Notify_Proxy *proxy); 00114 00115 /// The Proxy Container. 00116 ACE_Auto_Ptr< TAO_Notify_Proxy_Container > proxy_container_; 00117 }; 00118 00119 TAO_END_VERSIONED_NAMESPACE_DECL 00120 00121 #if defined (__ACE_INLINE__) 00122 #include "orbsvcs/Notify/Admin.inl" 00123 #endif /* __ACE_INLINE__ */ 00124 00125 #include /**/ "ace/post.h" 00126 00127 #endif /* TAO_Notify_ADMIN_H */