Package com.github.dandelion.core.config

Examples of com.github.dandelion.core.config.ConfigurationLoader


   *
   * @return an implementation of {@link ConfigurationLoader}.
   */
  public void initConfiguration(FilterConfig filterConfig) {

    ConfigurationLoader configurationLoader = null;

    LOG.debug("Initializing the configuration loader...");

    if (StringUtils.isNotBlank(System.getProperty(ConfigurationLoader.DANDELION_CONFLOADER_CLASS))) {
      Class<?> clazz;
      try {
        clazz = ClassUtils.getClass(System.getProperty(ConfigurationLoader.DANDELION_CONFLOADER_CLASS));
        configurationLoader = (ConfigurationLoader) ClassUtils.getNewInstance(clazz);
      }
      catch (Exception e) {
        LOG.warn(
            "Unable to instantiate the configured {} due to a {} exception. Falling back to the default one.",
            ConfigurationLoader.DANDELION_CONFLOADER_CLASS, e.getClass().getName(), e);
      }
    }

    if (configurationLoader == null) {
      configurationLoader = new StandardConfigurationLoader();
    }

    Properties userProperties = new Properties();
    userProperties.putAll(configurationLoader.loadUserConfiguration());
    configuration = new Configuration(filterConfig, userProperties);
  }
View Full Code Here

TOP

Related Classes of com.github.dandelion.core.config.ConfigurationLoader

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.