Exemplo n.º 1
0
        public IEnumerable <IValidationResult> Validate()
        {
            if (_builderFactory == null)
            {
                yield return(this.Failure("BuilderFactory", "The builder factory cannot be null."));
            }

            if (_settings.InputAddress == null)
            {
                string msg =
                    "The 'InputAddress' is null. #sadpanda I was expecting an address to be set like 'msmq://localhost/queue'";
                msg += "or 'rabbitmq://localhost/queue'. The InputAddress is a 'Uri' by the way.";

                yield return(this.Failure("InputAddress", msg));
            }

            foreach (IValidationResult result in _endpointFactoryConfigurator.Validate())
            {
                yield return(result.WithParentKey("EndpointFactory"));
            }

            foreach (IValidationResult result in _configurators.SelectMany(configurator => configurator.Validate()))
            {
                yield return(result);
            }

            foreach (IValidationResult result in _subscriptionRouterConfigurator.Validate())
            {
                yield return(result);
            }
        }
Exemplo n.º 2
0
        protected IEndpointFactory BuildEndpointFactory()
        {
            IConfigurationResult result = ConfigurationResult.CompileResults(_endpointFactoryConfigurator.Validate());

            IEndpointFactory endpointFactory;

            try
            {
                endpointFactory = _endpointFactoryConfigurator.CreateEndpointFactory();
            }
            catch (Exception ex)
            {
                throw new ConfigurationException(result, "An exception was thrown during endpoint cache creation", ex);
            }
            return(endpointFactory);
        }