示例#1
0
        internal HealthAlerts LoadConfiguration()
        {
            try
            {
                ConfigurationBuilder builder = new ConfigurationBuilder(filePath);
                builder.RegisterRootConfigurationObject(typeof(Alachisoft.NCache.Config.Dom.HealthAlerts));
                builder.ReadConfiguration();

                HealthAlerts[] healthAlerts = new HealthAlerts[builder.Configuration.Length];
                builder.Configuration.CopyTo(healthAlerts, 0);
                return(healthAlerts[0]);
            }
            catch (Exception ex)
            {
                return(new HealthAlerts());
            }
        }
示例#2
0
        void InitializeHealthDictionary(HealthAlerts healthAlerts)
        {
            if (healthAlerts != null)
            {
                foreach (DictionaryEntry data in healthAlerts.Resources)
                {
                    string collectorName = (string)data.Key;

                    if ((collectorName.ToLower().Equals(ResourceName.MIORRORQUEUEACTIVE) || collectorName.ToLower().Equals(ResourceName.BRIDGQQUEUE)) && (cacheContext.CacheImpl != null && !cacheContext.IsClusteredImpl))
                    {
                        continue;
                    }

                    AlertCollectorsBase collector = GetCollector(collectorName, (ResourceAtribute)data.Value);
                    alertDictionary.Add(collector, new AlertsObserver(this, collector));
                }
            }
        }