示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WorkerArgs"/> class.
        /// </summary>
        /// <param name="persister">The <see cref="IJobPersister"/> to use
        /// when saving jobs.</param>
        /// <param name="factory">The <see cref="IPipelineFactory"/> to use
        /// to create <see cref="Pipeline"/>s.</param>
        /// <exception cref="ArgumentNullException">persister or factory
        /// are null.</exception>
        public WorkerArgs(IJobPersister persister, IPipelineFactory factory)
        {
            if (persister == null)
            {
                throw new ArgumentNullException("persister");
            }

            if (factory == null)
            {
                throw new ArgumentNullException("factory");
            }

            Persister       = persister;
            PipelineFactory = factory;
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="JobManager"/> class.
        /// </summary>
        /// <param name="pluginFactory">The <see cref="IPluginFactory"/> used
        /// in pipeline construction</param>
        /// <param name="persister">The current <see cref="IJobPersister"/> for
        /// use in pipeline execution.</param>
        /// <exception cref="ArgumentNullException">pluginFactory or persister
        /// are null</exception>
        public JobManager(IPluginFactory pluginFactory, IJobPersister persister)
        {
            if (pluginFactory == null)
            {
                throw new ArgumentNullException("pluginFactory");
            }

            if (persister == null)
            {
                throw new ArgumentNullException("persister");
            }

            _tickets   = new List <IJobTicket>();
            _factory   = pluginFactory;
            _persister = persister;
            _processor = new BatchProcessor(pluginFactory, _persister);
        }
示例#3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BatchProcessor"/>
        /// class.
        /// </summary>
        /// <param name="factory">The <see cref="IPluginFactory"/> to use
        /// when converting definitions into jobs.</param>
        /// <param name="persister">The <see cref="IJobPersister"/> to save job
        /// results to</param>
        /// <exception cref="ArgumentNullException">factory or persister are
        /// null</exception>
        public BatchProcessor(IPluginFactory factory, IJobPersister persister)
        {
            if (factory == null)
            {
                throw new ArgumentNullException("factory");
            }

            if (persister == null)
            {
                throw new ArgumentNullException("persister");
            }

            _queue                  = new JobQueue();
            _executor               = new QueueExecutor(_queue);
            _executor.Worker        = new TicketWorker();
            _executor.PluginFactory = factory;
            _executor.Persister     = persister;
        }
 public StartEngineJob(IJobPersister jobPersister) : base(jobPersister)
 {
 }
 public JobBase(IJobPersister jobPersister)
 {
     _jobPersister = jobPersister;
 }