Exemplo n.º 1
0
        /// <summary>
        /// Initialize a new instance of the Warden using the provided configuration.
        /// </summary>
        /// <param name="name">Customizable name of the Warden.</param>
        /// <param name="configuration">Configuration of Warden</param>
        internal Warden(string name, WardenConfiguration configuration)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentException("Warden name can not be empty.", nameof(name));
            }
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration), "Warden configuration has not been provided.");
            }

            Name           = name;
            _configuration = configuration;
            _logger        = _configuration.WardenLoggerProvider();
        }
Exemplo n.º 2
0
        internal WardenManager(IWarden warden, WardenManagerConfiguration configuration)
        {
            if (warden == null)
            {
                throw new ArgumentException("Warden instance can not be null.", nameof(warden));
            }
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration),
                                                "Warden Manager configuration has not been provided.");
            }

            _warden        = warden;
            _configuration = configuration;
            _commandSource = _configuration.WardenCommandSourceProvider();
            _eventHandler  = _configuration.WardenEventHandlerProvider();
            _logger        = _configuration.WardenLoggerProvider();
            _commandSource.CommandReceivedAsync += async(command) => await HandleCommandAsync(command);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initialize a new instance of the IterationProcessor using the provided configuration.
 /// </summary>
 /// <param name="configuration">Configuration of IterationProcessor</param>
 public IterationProcessor(IterationProcessorConfiguration configuration)
 {
     _configuration = configuration;
     _logger        = _configuration.WardenLoggerProvider();
 }
Exemplo n.º 4
0
 private void ApplyConfiguration()
 {
     _configuration = _configurator.Build();
     _logger        = _configuration.WardenLoggerProvider();
 }