Go to the documentation of this file.00001
00002 #ifndef MONITOREVENTCHANNELFACTORY_H
00003 #define MONITOREVENTCHANNELFACTORY_H
00004
00005 #include "ace/pre.h"
00006
00007 #include "ace/Hash_Map_Manager_T.h"
00008
00009 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00010 # pragma once
00011 #endif
00012
00013 #include "ace/Vector_T.h"
00014 #include "ace/Monitor_Base.h"
00015
00016 #include "orbsvcs/Notify/EventChannelFactory.h"
00017 #include "orbsvcs/Notify/MonitorControl/Timestamp_Monitor.h"
00018 #include "orbsvcs/Notify/MonitorControlExt/NotifyMonitoringExtS.h"
00019
00020 #if defined (TAO_HAS_MONITOR_FRAMEWORK) && (TAO_HAS_MONITOR_FRAMEWORK == 1)
00021
00022 using namespace ACE_VERSIONED_NAMESPACE_NAME::ACE::Monitor_Control;
00023
00024 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00025
00026 class TAO_Notify_MC_Ext_Export TAO_MonitorEventChannelFactory
00027 : public TAO_Notify_EventChannelFactory,
00028 public virtual POA_NotifyMonitoringExt::EventChannelFactory
00029 {
00030 public:
00031
00032
00033 TAO_MonitorEventChannelFactory (const char* name);
00034
00035
00036 ~TAO_MonitorEventChannelFactory (void);
00037
00038
00039
00040 virtual CosNotifyChannelAdmin::EventChannel_ptr
00041 create_named_channel(const CosNotification::QoSProperties& initial_qos,
00042 const CosNotification::AdminProperties& initial_admin,
00043 CosNotifyChannelAdmin::ChannelID_out id,
00044 const char* name);
00045
00046
00047 virtual CosNotifyChannelAdmin::EventChannel_ptr
00048 create_channel(const CosNotification::QoSProperties& initial_qos,
00049 const CosNotification::AdminProperties& initial_admin,
00050 CosNotifyChannelAdmin::ChannelID_out id);
00051
00052
00053
00054 virtual void remove (TAO_Notify_EventChannel* channel);
00055
00056
00057
00058 typedef ACE_Hash_Map_Manager<ACE_CString,
00059 CosNotifyChannelAdmin::ChannelID,
00060 ACE_SYNCH_NULL_MUTEX> Map;
00061
00062 private:
00063 size_t get_consumers (CosNotifyChannelAdmin::ChannelID id);
00064 size_t get_suppliers (CosNotifyChannelAdmin::ChannelID id);
00065 size_t get_ecs (Monitor_Control_Types::NameList* names, bool active);
00066
00067 friend class EventChannels;
00068
00069 class Unbinder
00070 {
00071 public:
00072 Unbinder (Map& map,
00073 const ACE_CString& name);
00074 ~Unbinder (void);
00075 void release (void);
00076
00077 private:
00078 Map& map_;
00079 const ACE_CString& name_;
00080 bool released_;
00081 };
00082
00083 TAO_SYNCH_RW_MUTEX mutex_;
00084 ACE_CString name_;
00085 Map map_;
00086 ACE_Vector<ACE_CString> stat_names_;
00087 };
00088
00089 TAO_END_VERSIONED_NAMESPACE_DECL
00090
00091 #endif
00092
00093 #include "ace/post.h"
00094
00095 #endif