コード例 #1
0
 private HealthMonitoringSectionHelper()
 {
     try
     {
         this._section = RuntimeConfig.GetAppConfig().HealthMonitoring;
     }
     catch (Exception exception)
     {
         if (HttpRuntime.InitializationException == null)
         {
             HttpRuntime.InitializationException = exception;
         }
         this._section = RuntimeConfig.GetAppLKGConfig().HealthMonitoring;
         if (this._section == null)
         {
             throw;
         }
     }
     this._enabled = this._section.Enabled;
     if (this._enabled)
     {
         this.BasicSanityCheck();
         this._ruleInfos = new ArrayList();
         this._customEvaluatorInstances          = new Hashtable();
         this._providerInstances                 = new ProviderInstances(this._section);
         this._cachedMatchedRulesForCustomEvents = new Hashtable(new WebBaseEventKeyComparer());
         _cachedMatchedRules = new ArrayList[WebEventCodes.GetEventArrayDimensionSize(0), WebEventCodes.GetEventArrayDimensionSize(1)];
         this.BuildRuleInfos();
         this._providerInstances.CleanupUninitProviders();
     }
 }
コード例 #2
0
        HealthMonitoringSectionHelper()
        {
            // Handle config exceptions so we can still log messages to the event log.
            try {
                _section = RuntimeConfig.GetAppConfig().HealthMonitoring;
            }
            catch (Exception e) {
                // If InitializationException has not already been set, then this exception
                // is happening because the <healthMonitoring> section has an error.
                // By setting InitializationException, we allow the exception to be displayed in the response.
                // If InitializationException is already set, ignore this exception so we can
                // display the original in the response.
                if (HttpRuntime.InitializationException == null)
                {
                    HttpRuntime.InitializationException = e;
                }
                _section = RuntimeConfig.GetAppLKGConfig().HealthMonitoring;
                // WOS 1965670: if we fail to get the section throw the previous error
                if (_section == null)
                {
                    throw;
                }
            }

            _enabled = _section.Enabled;

            if (!_enabled)
            {
                return;
            }

            // First run some basic sanity check
            BasicSanityCheck();

            // Init some class members
            _ruleInfos = new ArrayList();
            _customEvaluatorInstances          = new Hashtable();
            _providerInstances                 = new ProviderInstances(_section);
            _cachedMatchedRulesForCustomEvents = new Hashtable(new WebBaseEventKeyComparer());
            _cachedMatchedRules                = new ArrayList[WebEventCodes.GetEventArrayDimensionSize(0),
                                                               WebEventCodes.GetEventArrayDimensionSize(1)];

            BuildRuleInfos();

            _providerInstances.CleanupUninitProviders();
        }