Package org.springframework.core.env

Examples of org.springframework.core.env.ConfigurableEnvironment.merge()


      values.put(fullyQualifiedKey(moduleDefinition, name), nakedPS.getProperty(name));
    }
    EnumerablePropertySource<?> modulePS = new MapPropertySource(propertySourceName, values);
    ConfigurableEnvironment moduleEnvironment = new StandardEnvironment();
    // Append the rootEnvironment
    moduleEnvironment.merge(rootEnvironment);
    // The global environment has been loaded by boot too and
    // its PS of interest was also named "applicationConfigurationProperties"
    moduleEnvironment.getPropertySources().addBefore(APPLICATION_CONFIGURATION_PROPERTIES, modulePS);
    return moduleEnvironment;
  }
View Full Code Here


   * Construct a new environment and use Spring Boot to populate its property sources using
   * {@link ConfigFileApplicationListener}.
   */
  private ConfigurableEnvironment loadPropertySources(final String searchLocation, final String baseName) {
    final ConfigurableEnvironment environment = new StandardEnvironment();
    environment.merge(parentEnvironment);
    new ConfigFileApplicationListener() {

      public void apply() {
        setSearchLocations(searchLocation);
        // We'd like to do 'setSearchNames(baseName)', but the environment property
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.