/// <summary>
        /// Initializes a new instance of the <see cref="T:System.Object"/> class.
        /// </summary>
        public Dispatcher(DispatcherConfiguration configuration)
        {
            if (configuration.ServiceLocator == null)
            {
                throw new ArgumentException("Unity Container is not registered for distributor.");
            }

            if (configuration.DispatcherHandlerRegistry == null)
            {
                throw new ArgumentException("Dispatcher Handler Registry is null in distributor.");
            }

            _serviceLocator = configuration.ServiceLocator;
            _registry       = configuration.DispatcherHandlerRegistry;
            _maxRetries     = configuration.NumberOfRetries;

            // order handlers
            _registry.InsureOrderOfHandlers();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="T:System.Object"/> class.
 /// </summary>
 public DispatcherConfiguration()
 {
     DispatcherHandlerRegistry = new DispatcherHandlerRegistry();
     NumberOfRetries           = 1;
 }