Package ratpack.util.internal

Examples of ratpack.util.internal.TypeCoercingProperties.asClass()


    Properties properties = data.getProperties();
    Map<String, String> envVars = data.getEnvVars();
    TypeCoercingProperties props = new TypeCoercingProperties(properties, data.getClassLoader());
    try {
      Class<HandlerFactory> handlerFactoryClass;
      handlerFactoryClass = props.asClass(HANDLER_FACTORY, HandlerFactory.class);
      if (handlerFactoryClass == null) {
        throw new LaunchException("No handler factory class specified (config property: " + HANDLER_FACTORY + ")");
      }

      int defaultPort = DEFAULT_PORT;
View Full Code Here


    }
    ConfigurationFactoryFactory configurationFactoryFactory = new DefaultConfigurationFactoryFactory(classLoader);
    ConfigurationFactory configurationFactory = configurationFactoryFactory.build(configurationSource);
    if (configurationClass == null) {
      try {
        configurationClass = props.asClass(LaunchConfigs.Property.CONFIGURATION_CLASS, Configuration.class);
      } catch (ClassNotFoundException ex) {
        throw new ConfigurationException("Could not load specified configuration class", ex);
      }
    }
    Configuration configuration = configurationFactory.build(configurationClass, configurationSource);
View Full Code Here

  @Override
  public ConfigurationFactory build(ConfigurationSource configurationSource) throws ConfigurationException {
    TypeCoercingProperties props = LaunchConfigsInternal.consolidatePropertiesFromGlobalProperties(
      StandardSystemProperty.USER_DIR.value(), classLoader, configurationSource.getOverrideProperties(), configurationSource.getDefaultProperties());
    try {
      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);
View Full Code Here

    Properties properties = data.getProperties();
    Map<String, String> envVars = data.getEnvVars();
    TypeCoercingProperties props = data.getTypeCoercingProperties();
    Class<HandlerFactory> handlerFactoryClass;
    try {
      handlerFactoryClass = props.asClass(HANDLER_FACTORY, HandlerFactory.class);
      if (handlerFactoryClass == null) {
        throw new LaunchException("No handler factory class specified (config property: " + HANDLER_FACTORY + ")");
      }

      int defaultPort = LaunchConfig.DEFAULT_PORT;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.