Exemplo n.º 1
0
        public LogAnalyserProxy(ITaskScheduler scheduler,
                                ILogFile logFile,
                                ILogAnalyserPlugin plugin,
                                ILogAnalyserConfiguration configuration,
                                IDataSourceAnalysisListener listener)
        {
            if (scheduler == null)
            {
                throw new ArgumentNullException(nameof(scheduler));
            }
            if (logFile == null)
            {
                throw new ArgumentNullException(nameof(logFile));
            }
            if (plugin == null)
            {
                throw new ArgumentNullException(nameof(plugin));
            }
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }
            if (listener == null)
            {
                throw new ArgumentNullException(nameof(listener));
            }

            _syncRoot      = new object();
            _scheduler     = scheduler;
            _logFile       = logFile;
            _plugin        = plugin;
            _configuration = configuration;
            _listener      = listener;
        }
Exemplo n.º 2
0
        private IDataSourceAnalysisHandle CreatAnalysisFor(AnalyserPluginId id,
                                                           ILogFile logFile,
                                                           ILogAnalyserConfiguration configuration,
                                                           IDataSourceAnalysisListener listener)
        {
            IDataSourceAnalysisHandle analysis;
            ILogAnalyserPlugin        plugin;

            if (_factoriesById.TryGetValue(id, out plugin))
            {
                analysis = new LogAnalyserProxy(_scheduler, logFile, plugin, configuration, listener);
            }
            else
            {
                Log.ErrorFormat("Unable to find plugin '{0}', analysis will be skipped", id);
                analysis = new DummyAnalysis();
            }

            return(analysis);
        }
Exemplo n.º 3
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);
            }
        }