00001 /* -*- C++ -*- */ 00002 /** 00003 * @file Admin.h 00004 * 00005 * Admin.h,v 1.17 2006/03/14 06:14:34 jtc Exp 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 /// Constuctor 00048 TAO_Notify_Admin (); 00049 00050 /// Destructor 00051 virtual ~TAO_Notify_Admin (); 00052 00053 /// Init 00054 void init (TAO_Notify::Topology_Parent * parent ACE_ENV_ARG_DECL); 00055 00056 /// Insert the proxy in the <proxy_container_>. 00057 void insert (TAO_Notify_Proxy* proxy ACE_ENV_ARG_DECL); 00058 00059 /// Remove type from container_ 00060 void remove (TAO_Notify_Proxy *proxy ACE_ENV_ARG_DECL); 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 00070 /// Access Filter operator 00071 CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator (void); 00072 00073 /// Obtain the Admin's subscribed types. 00074 void subscribed_types (TAO_Notify_EventTypeSeq& subscribed_types 00075 ACE_ENV_ARG_DECL); 00076 00077 TAO_Notify_EventChannel * event_channel () const; 00078 /// Shutdown 00079 virtual int shutdown (ACE_ENV_SINGLE_ARG_DECL); 00080 00081 virtual void save_persistent (TAO_Notify::Topology_Saver& saver ACE_ENV_ARG_DECL); 00082 virtual TAO_Notify::Topology_Object* load_child (const ACE_CString &type, 00083 CORBA::Long id, const TAO_Notify::NVPList& attrs ACE_ENV_ARG_DECL); 00084 virtual void reconnect (ACE_ENV_SINGLE_ARG_DECL); 00085 00086 void set_default (bool is_default); 00087 bool is_default () const; 00088 virtual void load_attrs(const TAO_Notify::NVPList& attrs); 00089 00090 protected: 00091 void save_attrs (TAO_Notify::NVPList& attrs); 00092 virtual const char * get_admin_type_name (void) const = 0; 00093 00094 typedef TAO_Notify_Container_T<TAO_Notify_Proxy> TAO_Notify_Proxy_Container; 00095 00096 TAO_Notify_Proxy_Container& proxy_container(); 00097 /// = Data Members 00098 00099 /// The EventChannel. 00100 TAO_Notify_EventChannel::Ptr ec_; 00101 00102 00103 /// The types that we've subscribed our proxy objects with the event manager. 00104 TAO_Notify_EventTypeSeq subscribed_types_; 00105 00106 /// Filter Administration 00107 TAO_Notify_FilterAdmin filter_admin_; 00108 00109 /// Filter operator 00110 CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator_; 00111 00112 bool is_default_; 00113 private: 00114 /// The Proxy Container. 00115 ACE_Auto_Ptr< TAO_Notify_Proxy_Container > proxy_container_; 00116 }; 00117 00118 TAO_END_VERSIONED_NAMESPACE_DECL 00119 00120 #if defined (__ACE_INLINE__) 00121 #include "orbsvcs/Notify/Admin.inl" 00122 #endif /* __ACE_INLINE__ */ 00123 00124 #include /**/ "ace/post.h" 00125 00126 #endif /* TAO_Notify_ADMIN_H */