Go to the documentation of this file.00001
00002
00003 #ifndef MONITOREVENTCHANNEL_H
00004 #define MONITOREVENTCHANNEL_H
00005
00006 #include "ace/pre.h"
00007
00008 #include "ace/Vector_T.h"
00009
00010 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00011 # pragma once
00012 #endif
00013
00014 #include "ace/Monitor_Control_Types.h"
00015
00016 #include "orbsvcs/Notify/EventChannel.h"
00017
00018 #include "orbsvcs/Notify/MonitorControlExt/NotifyMonitoringExtS.h"
00019
00020 #if defined (TAO_HAS_MONITOR_FRAMEWORK) && (TAO_HAS_MONITOR_FRAMEWORK == 1)
00021
00022 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00023
00024 namespace ACE
00025 {
00026 namespace Monitor_Control
00027 {
00028 class Monitor_Base;
00029 }
00030 }
00031
00032 ACE_END_VERSIONED_NAMESPACE_DECL
00033
00034 using namespace ACE_VERSIONED_NAMESPACE_NAME::ACE::Monitor_Control;
00035
00036 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00037
00038 class TAO_Notify_ThreadPool_Task;
00039
00040 class TAO_Notify_MC_Ext_Export TAO_MonitorEventChannel
00041 : public virtual TAO_Notify_EventChannel,
00042 public virtual POA_NotifyMonitoringExt::EventChannel
00043 {
00044 public:
00045
00046
00047 TAO_MonitorEventChannel (const char* name);
00048
00049
00050 ~TAO_MonitorEventChannel (void);
00051
00052
00053 const ACE_CString& name (void) const;
00054
00055
00056 bool register_statistic (const ACE_CString& name,
00057 Monitor_Base* stat);
00058
00059
00060 bool unregister_statistic (const ACE_CString& name);
00061
00062
00063 void map_supplier_proxy (CosNotifyChannelAdmin::ProxyID id,
00064 const ACE_CString& name);
00065
00066
00067 void map_consumer_proxy (CosNotifyChannelAdmin::ProxyID id,
00068 const ACE_CString& name);
00069
00070
00071 virtual void cleanup_proxy (CosNotifyChannelAdmin::ProxyID id,
00072 bool is_supplier,
00073 bool experienced_timeout);
00074
00075
00076 virtual void remove_consumeradmin (CosNotifyChannelAdmin::AdminID id);
00077
00078
00079 virtual void remove_supplieradmin (CosNotifyChannelAdmin::AdminID id);
00080
00081
00082
00083
00084 void add_stats (const char* name = 0);
00085
00086 virtual CosNotifyChannelAdmin::ConsumerAdmin_ptr
00087 new_for_consumers (CosNotifyChannelAdmin::InterFilterGroupOperator op,
00088 CosNotifyChannelAdmin::AdminID_out id);
00089
00090 virtual CosNotifyChannelAdmin::ConsumerAdmin_ptr
00091 named_new_for_consumers (
00092 CosNotifyChannelAdmin::InterFilterGroupOperator op,
00093 CosNotifyChannelAdmin::AdminID_out id,
00094 const char* name);
00095
00096 virtual CosNotifyChannelAdmin::SupplierAdmin_ptr
00097 new_for_suppliers (CosNotifyChannelAdmin::InterFilterGroupOperator op,
00098 CosNotifyChannelAdmin::AdminID_out id);
00099
00100 virtual CosNotifyChannelAdmin::SupplierAdmin_ptr
00101 named_new_for_suppliers (
00102 CosNotifyChannelAdmin::InterFilterGroupOperator op,
00103 CosNotifyChannelAdmin::AdminID_out id,
00104 const char* name);
00105
00106 private:
00107 size_t get_consumers (Monitor_Control_Types::NameList* names);
00108 size_t get_suppliers (Monitor_Control_Types::NameList* names);
00109 void get_timedout_consumers (Monitor_Control_Types::NameList* names);
00110 size_t get_consumeradmins (Monitor_Control_Types::NameList* names);
00111 size_t get_supplieradmins (Monitor_Control_Types::NameList* names);
00112 TAO_Notify_ThreadPool_Task* get_threadpool_task (
00113 CosNotifyChannelAdmin::AdminID id);
00114 size_t calculate_queue_size (bool count);
00115 double get_oldest_event (void);
00116 void determine_slowest_consumer (Monitor_Control_Types::NameList* names);
00117 bool destroy_consumer (CosNotifyChannelAdmin::ProxyID id);
00118 bool destroy_supplier (CosNotifyChannelAdmin::ProxyID id);
00119
00120
00121 friend class RemoveConsumerSupplierControl;
00122 friend class EventChannelConsumersSuppliers;
00123 friend class EventChannelTimedoutConsumers;
00124 friend class EventChannelConsumerSupplierAdmins;
00125 friend class SlowestConsumers;
00126 friend class QueuedEvents;
00127 friend class OldestEvent;
00128
00129 typedef ACE_Hash_Map_Manager<CORBA::Long,
00130 ACE_CString,
00131 ACE_SYNCH_NULL_MUTEX> Map;
00132
00133 size_t get_admins (Map& map,
00134 const CosNotifyChannelAdmin::AdminIDSeq& ids,
00135 Monitor_Control_Types::NameList* names);
00136 bool is_duplicate_name (const Map& map,
00137 const ACE_CString& name) const;
00138
00139 void remove_list_name (Monitor_Control_Types::NameList& list,
00140 const ACE_CString& name);
00141
00142 ACE_CString name_;
00143
00144 mutable TAO_SYNCH_MUTEX names_mutex_;
00145 Monitor_Control_Types::NameList stat_names_;
00146 Monitor_Control_Types::NameList control_names_;
00147
00148 mutable TAO_SYNCH_RW_MUTEX supplier_mutex_;
00149 Map supplier_map_;
00150
00151 mutable TAO_SYNCH_RW_MUTEX consumer_mutex_;
00152 Map consumer_map_;
00153
00154 mutable TAO_SYNCH_RW_MUTEX timedout_supplier_mutex_;
00155 Map timedout_supplier_map_;
00156
00157 mutable TAO_SYNCH_RW_MUTEX supplieradmin_mutex_;
00158 Map supplieradmin_map_;
00159
00160 mutable TAO_SYNCH_RW_MUTEX consumeradmin_mutex_;
00161 Map consumeradmin_map_;
00162 };
00163
00164 TAO_END_VERSIONED_NAMESPACE_DECL
00165
00166 #endif
00167
00168 #include "ace/post.h"
00169
00170 #endif