Beispiel #1
0
        private void RestartAnalysis()
        {
            if (_currentAnalysis != null)
            {
                _logAnalyserEngine.RemoveAnalysis(_currentAnalysis);
                _currentAnalysis = null;
            }

            var configuration = new DataSourceAnalysisConfiguration
            {
                PluginId      = _template.AnalyserPluginId,
                Configuration = _configuration
            };

            _currentAnalysis = _logAnalyserEngine.CreateAnalysis(_logFile, configuration, this);
            // Now that we've assigned the current analysis, we can actually start it
            // (otherwise there would be the race condition of being notified through the
            // listener interface before we've assigned the new handle, effectively losing
            // the values provided by the callback).
            _currentAnalysis.Start();
        }
Beispiel #2
0
        public IDataSourceAnalysisHandle CreateAnalysis(ILogFile logFile, DataSourceAnalysisConfiguration configuration,
                                                        IDataSourceAnalysisListener listener)
        {
            if (logFile == null)
            {
                throw new ArgumentNullException(nameof(logFile));
            }
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }
            if (listener == null)
            {
                throw new ArgumentNullException(nameof(listener));
            }

            lock (_syncRoot)
            {
                var analysis = CreatAnalysisFor(configuration.PluginId, logFile, configuration.Configuration, listener);
                _analyses.Add(analysis);
                // DO NOT ANYTHING IN BETWEEN ADD AND RETURN
                return(analysis);
            }
        }