Package org.springframework.core.env

Examples of org.springframework.core.env.MutablePropertySources


public class PropertySourcesConfigurer extends ApplicationContextConfigurerAdapter
{
  private final MutablePropertySources propertySources;

  public PropertySourcesConfigurer( PropertySources propertySources ) {
    this.propertySources = new MutablePropertySources( propertySources );
  }
View Full Code Here


  public PropertySourcesConfigurer( PropertySources propertySources ) {
    this.propertySources = new MutablePropertySources( propertySources );
  }

  public PropertySourcesConfigurer( PropertySource<?>... propertySources ) {
    this.propertySources = new MutablePropertySources();

    for ( PropertySource<?> propertySource : propertySources ) {
      this.propertySources.addLast( propertySource );
    }
  }
View Full Code Here

    ConfigurableEnvironment env = (ConfigurableEnvironment) contextInfo.getModuleInfo( "directOnModule" )
                                                                       .getApplicationContext().getEnvironment();

    assertNotNull( env );

    MutablePropertySources sources = env.getPropertySources();
    assertNotNull( sources );
    assertEquals( 8, sources.size() );

    assertEquals( 4, sources.precedenceOf( sources.get( StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME ) ) );
    assertEquals( 5, sources.precedenceOf( sources.get( StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME ) ) );
    assertEquals( 7, sources.precedenceOf( sources.get( "PropertiesModuleSettings: default values" ) ) );
  }
View Full Code Here

   * Singleton constructor.
   */
  private FimeroConfigKit() {

    this.ctx = new AnnotationConfigApplicationContext();
    MutablePropertySources mps = this.ctx.getEnvironment()
        .getPropertySources();

    String runtimeContext = RuntimeContext.getActiveAsString();
    RuntimeContextPropertySource rcps = ConfigurationUtils
        .mergeRuntimeContextProperties(runtimeContext);
    mps.addFirst(rcps);
    // TODO only scanning one package but can expand to an array in future
    this.ctx.scan(CONFIG_PACKAGE);
    this.ctx.refresh();
  }
View Full Code Here

TOP

Related Classes of org.springframework.core.env.MutablePropertySources

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.