Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BackgroundJobClient"/> class
        /// with a specified job storage and job creation process.
        /// </summary>
        /// 
        /// <exception cref="ArgumentNullException"><paramref name="storage"/> argument is null.</exception>
        /// <exception cref="ArgumentNullException"><paramref name="process"/> argument is null.</exception>
        public BackgroundJobClient(JobStorage storage, IJobCreationProcess process)
        {
            if (storage == null) throw new ArgumentNullException("storage");
            if (process == null) throw new ArgumentNullException("process");

            _connection = storage.GetConnection();
            _process = process;
        }
Ejemplo n.º 2
0
        public RecurringJobManager([NotNull] JobStorage storage, [NotNull] IBackgroundJobClient client)
        {
            if (storage == null) throw new ArgumentNullException("storage");
            if (client == null) throw new ArgumentNullException("client");

            _storage = storage;
            _client = client;
        }
Ejemplo n.º 3
0
        public BackgroundJobServer(BackgroundJobServerOptions options, JobStorage storage)
        {
            if (options == null) throw new ArgumentNullException("options");
            if (storage == null) throw new ArgumentNullException("storage");

            _options = options;
            _storage = storage;

            _serverId = String.Format("{0}:{1}", _options.ServerName.ToLowerInvariant(), Process.GetCurrentProcess().Id);

            // ReSharper disable once DoNotCallOverridableMethodsInConstructor
            _bootstrapSupervisor = GetBootstrapSupervisor();
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BackgroundJobClient"/> class
 /// with a specified job storage and job creation process.
 /// </summary>
 /// 
 /// <exception cref="ArgumentNullException"><paramref name="storage"/> argument is null.</exception>
 /// <exception cref="ArgumentNullException"><paramref name="process"/> argument is null.</exception>
 public BackgroundJobClient(
     JobStorage storage, 
     IStateMachineFactory stateMachineFactory, 
     IJobCreationProcess process)
 {
     if (storage == null) throw new ArgumentNullException("storage");
     if (stateMachineFactory == null) throw new ArgumentNullException("stateMachineFactory");
     if (process == null) throw new ArgumentNullException("process");
     
     _storage = storage;
     _stateMachineFactory = stateMachineFactory;
     _process = process;
 }
Ejemplo n.º 5
0
 public BackgroundJobClient(JobStorage storage, IStateMachineFactory stateMachineFactory)
     : this(storage, stateMachineFactory, JobCreationProcess.Instance)
 {
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BackgroundJobClient"/> class
 /// with a specified storage and the default global
 /// <see cref="JobCreationProcess"/> instance.
 /// </summary>
 public BackgroundJobClient(JobStorage storage)
     : this(storage, new StateMachineFactory(storage))
 {
 }
Ejemplo n.º 7
0
 public void UseStorage(JobStorage storage)
 {
     Storage = storage;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BackgroundJobClient"/> class
 /// with a specified storage and the default global
 /// <see cref="JobCreationProcess"/> instance.
 /// </summary>
 public BackgroundJobClient(JobStorage storage)
     : this(storage, JobCreationProcess.Instance)
 {
 }
Ejemplo n.º 9
0
 public BackgroundJobClient(JobStorage storage, IStateMachineFactory stateMachineFactory)
     : this(storage, stateMachineFactory, JobCreationProcess.Instance)
 {
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BackgroundJobClient"/> class
 /// with a specified storage and the default global
 /// <see cref="JobCreationProcess"/> instance.
 /// </summary>
 public BackgroundJobClient(JobStorage storage)
     : this(storage, new StateMachineFactory(storage))
 {
 }