Package ratpack.configuration

Examples of ratpack.configuration.ConfigurationException


      Class<ConfigurationFactory> configurationFactoryClass = props.asClass(CONFIGURATION_FACTORY, ConfigurationFactory.class);
      if (configurationFactoryClass != null) {
        return configurationFactoryClass.newInstance();
      }
    } catch (ReflectiveOperationException ex) {
      throw new ConfigurationException("Could not instantiate specified configuration factory class " + props.asString(CONFIGURATION_FACTORY, null), ex);
    }
    ServiceLoader<ConfigurationFactory> serviceLoader = ServiceLoader.load(ConfigurationFactory.class, classLoader);
    try {
      return Iterables.getOnlyElement(serviceLoader, new DefaultConfigurationFactory());
    } catch (IllegalArgumentException ex) {
      throw new ConfigurationException("Multiple possible configuration factories were found; please specify one with the '" + CONFIGURATION_FACTORY + "' property", ex);
    }
  }
View Full Code Here


          node = objectMapper.readTree(yamlParser);
        }
      }
      return build(configurationClass, node);
    } catch (IOException ex) {
      throw new ConfigurationException("Failed to load configuration", ex);
    }
  }
View Full Code Here

    // TODO: environment overrides
    T configuration = objectMapper.readValue(new TreeTraversingParser(node), configurationClass);
    if (validator != null) {
      Set<ConstraintViolation<T>> violations = validator.validate(configuration);
      if (!violations.isEmpty()) {
        throw new ConfigurationException("Configuration failed validation: " + violations.toString());
      }
    }
    return configuration;
  }
View Full Code Here

    LaunchConfigBuilder builder = LaunchConfigBuilder.baseDir(baseDir).port(port).address(address).development(development).threads(threads).publicAddress(publicAddress).indexFiles(indexFiles).other(other).maxContentLength(maxContentLength).timeResponses(timeResponses).compressResponses(compressResponses).compressionMinSize(compressionMinSize).compressionWhiteListMimeTypes(compressionMimeTypeWhiteList).compressionBlackListMimeTypes(compressionMimeTypeBlackList).defaultRegistry(defaultRegistry);
    if (sslKeystore != null) {
      try (InputStream stream = Files.newInputStream(sslKeystore)) {
        builder.ssl(SSLContexts.sslContext(stream, sslKeystorePassword));
      } catch (IOException|GeneralSecurityException ex) {
        throw new ConfigurationException("Could not configure SSL from keystore " + sslKeystore);
      }
    }
    return builder.build(handlerFactory);
  }
View Full Code Here

TOP

Related Classes of ratpack.configuration.ConfigurationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.