public void Initialize(Logging.LogMngr logMngr) { if (logMngr != null) { _LogManager = logMngr; } }
public void StartWatcherAndSubmitters(int numSubmitters, int numReleasers, Logging.LogMngr logMngr, bool deleteFoldersOnRelease, int maxNumFilesInSubfolder, int sleepBetweenJobs) { if (numSubmitters <= 0) { numSubmitters = 1; } if (numReleasers < 0) { numReleasers = 0; } for (int i = 0; i < numSubmitters; i++) { JobSubmitter js = new JobSubmitter(); js.Initialize(logMngr); js.MaxNumberFilesInSubfolder = maxNumFilesInSubfolder; js.ThreadTag = "SubmitterThread_" + i; js.SleepBetweenJobs = sleepBetweenJobs; _SubmiterList.Add(js); ThreadPool.QueueUserWorkItem(js.Execute); } _JobWatcher.Initialize(logMngr); if (numReleasers > 0) { ThreadPool.QueueUserWorkItem(_JobWatcher.Execute); for (int i = 0; i < numReleasers; i++) { JobFinalizer jf = new JobFinalizer(); jf.Initialize(logMngr); jf.DeleteFolderOnRelease = deleteFoldersOnRelease; jf.ThreadTag = "FinalizerThread_" + i; _FinalizerList.Add(jf); ThreadPool.QueueUserWorkItem(jf.Execute); } } }