00001 /* -*- C++ -*- */ 00002 /** 00003 * @file Admin.h 00004 * 00005 * $Id: Admin.h 84685 2009-03-02 22:49:17Z mesnier_p $ 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, 00061 bool is_supplier, 00062 bool experienced_timeout); 00063 00064 /// Access Admin FilterAdmin. 00065 TAO_Notify_FilterAdmin& filter_admin (void); 00066 00067 /// Set Filter operator 00068 void filter_operator ( 00069 CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator); 00070 00071 /// Access Filter operator 00072 CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator (void); 00073 00074 /// Obtain the Admin's subscribed types. 00075 void subscribed_types (TAO_Notify_EventTypeSeq& subscribed_types); 00076 00077 TAO_Notify_EventChannel * event_channel () const; 00078 00079 /// Shutdown 00080 virtual int shutdown (void); 00081 00082 virtual void save_persistent (TAO_Notify::Topology_Saver& saver); 00083 virtual TAO_Notify::Topology_Object* load_child (const ACE_CString &type, 00084 CORBA::Long id, const TAO_Notify::NVPList& attrs); 00085 virtual void reconnect (void); 00086 00087 virtual void validate (); 00088 00089 void set_default (bool is_default); 00090 bool is_default () const; 00091 virtual void load_attrs(const TAO_Notify::NVPList& attrs); 00092 00093 protected: 00094 void save_attrs (TAO_Notify::NVPList& attrs); 00095 virtual const char * get_admin_type_name (void) const = 0; 00096 00097 typedef TAO_Notify_Container_T<TAO_Notify_Proxy> TAO_Notify_Proxy_Container; 00098 00099 TAO_Notify_Proxy_Container& proxy_container(); 00100 /// = Data Members 00101 00102 /// The EventChannel. 00103 TAO_Notify_EventChannel::Ptr ec_; 00104 00105 /// The types that we've subscribed our proxy objects with the event manager. 00106 TAO_Notify_EventTypeSeq subscribed_types_; 00107 00108 /// Filter Administration 00109 TAO_Notify_FilterAdmin filter_admin_; 00110 00111 /// Filter operator 00112 CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator_; 00113 00114 bool is_default_; 00115 private: 00116 /// Remove type from container_ 00117 void remove (TAO_Notify_Proxy *proxy); 00118 00119 /// The Proxy Container. 00120 ACE_Auto_Ptr< TAO_Notify_Proxy_Container > proxy_container_; 00121 }; 00122 00123 TAO_END_VERSIONED_NAMESPACE_DECL 00124 00125 #if defined (__ACE_INLINE__) 00126 #include "orbsvcs/Notify/Admin.inl" 00127 #endif /* __ACE_INLINE__ */ 00128 00129 #include /**/ "ace/post.h" 00130 00131 #endif /* TAO_Notify_ADMIN_H */