private void LoadRelationMappings(IRelationLoader relationLoader) { this._cronSchedulers = relationLoader.LoadAllCronSchedulers(); this._directoryWatchers = relationLoader.LoadAllDirectoryWatchers(); this._processDetails = relationLoader.LoadProcessDetails(); this._processHandlerRelation = relationLoader.LoadHandlerTaskRelationships(); }
public void Restart(IRelationLoader relationLoader) { try { Stop(); ClearResources(); LoadRelationMappings(relationLoader); Start(); } catch { // log exception // dispose of resources // shut down Dispose(); throw; } }
// add second parameter that passes in the logger // Use ThatLogger and pass in interface ILogger public Engine(IRelationLoader relationLoader, ILogger logger) { this._logSource = Environment.MachineName; this._logger = logger ?? LoggerFactory.Current.GetFileLogger("tie.log"); this._activeProcesses = new ConcurrentBag <IProcess>(); this._failedWatchers = new ConcurrentQueue <IDirectoryWatcher>(); this._hasStarted = false; this._failedWatchersWorker = new BackgroundWorker(); this._failedWatchersWorker.DoWork += ProcessFailedWatchersQueue; InstanceId = Guid.NewGuid(); LoadRelationMappings(relationLoader); SubscribeToHandlerEvents(); }
public Engine(IRelationLoader relationLoader) : this(relationLoader, null) { }