Example #1
0
 private void LoadRelationMappings(IRelationLoader relationLoader)
 {
     this._cronSchedulers         = relationLoader.LoadAllCronSchedulers();
     this._directoryWatchers      = relationLoader.LoadAllDirectoryWatchers();
     this._processDetails         = relationLoader.LoadProcessDetails();
     this._processHandlerRelation = relationLoader.LoadHandlerTaskRelationships();
 }
Example #2
0
 public void Restart(IRelationLoader relationLoader)
 {
     try
     {
         Stop();
         ClearResources();
         LoadRelationMappings(relationLoader);
         Start();
     }
     catch
     {
         // log exception
         // dispose of resources
         // shut down
         Dispose();
         throw;
     }
 }
Example #3
0
        // 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();
        }
Example #4
0
 public Engine(IRelationLoader relationLoader)
     : this(relationLoader, null)
 {
 }