Beispiel #1
0
        public static ICadApplicationInstanceProvider FindApplicationProvider(this BatchJob job, ICadApplicationInstanceProvider[] appProviders)
        {
            var appProvider = appProviders.FirstOrDefault(
                p => string.Equals(p.Descriptor.ApplicationId, job.ApplicationId,
                                   StringComparison.CurrentCultureIgnoreCase));

            if (appProvider == null)
            {
                throw new UserException("Failed to find the application provider for this job file");
            }

            return(appProvider);
        }
Beispiel #2
0
        public BatchRunner(BatchJob job, ICadApplicationInstanceProvider[] appProviders,
                           TextWriter journalWriter, IProgressHandler progressHandler,
                           IBatchApplicationProxy batchAppProxy,
                           IJobManager jobMgr, IXLogger logger,
                           Func <TimeSpan?, IResilientWorker <BatchJobContext> > workerFact, IPopupKiller popupKiller)
        {
            m_Job             = job;
            m_JournalWriter   = journalWriter;
            m_ProgressHandler = progressHandler;
            m_AppProvider     = job.FindApplicationProvider(appProviders);
            m_MacroRunnerSvc  = m_AppProvider.MacroRunnerService;

            m_WorkerFact    = workerFact;
            m_BatchAppProxy = batchAppProxy;

            m_PopupKiller = popupKiller;
            m_PopupKiller.PopupNotClosed += OnPopupNotClosed;

            m_Logger = logger;

            m_JobMgr = jobMgr;
        }