Package org.springframework.core.env

Examples of org.springframework.core.env.PropertiesPropertySource


    // populate properties for customer
    props.setProperty("host", "host.for." + customer);
    props.setProperty("user", "user");
    props.setProperty("password", "password");
    props.setProperty("remote.directory", "/tmp");
    PropertiesPropertySource pps = new PropertiesPropertySource("ftpprops", props);
    env.getPropertySources().addLast(pps);
    ctx.setEnvironment(env);
  }
View Full Code Here


          }
        );
      }
      try {
        PropertySource<?> localPropertySource =
          new PropertiesPropertySource(LOCAL_PROPERTIES_PROPERTY_SOURCE_NAME, this.mergeProperties());
        if (this.localOverride) {
          this.propertySources.addFirst(localPropertySource);
        }
        else {
          this.propertySources.addLast(localPropertySource);
View Full Code Here

          }
        );
      }
      try {
        PropertySource<?> localPropertySource =
          new PropertiesPropertySource(LOCAL_PROPERTIES_PROPERTY_SOURCE_NAME, this.mergeProperties());
        if (this.localOverride) {
          this.propertySources.addFirst(localPropertySource);
        }
        else {
          this.propertySources.addLast(localPropertySource);
View Full Code Here

    GrailsApplication grailsApplication;

    public GrailsEnvironment(GrailsApplication grailsApplication) {
        this.grailsApplication = grailsApplication;
        getPropertySources().addFirst(new GrailsConfigPropertySource());
        getPropertySources().addFirst(new PropertiesPropertySource("systemProperties", System.getProperties()));
    }
View Full Code Here

          }
        );
      }
      try {
        PropertySource<?> localPropertySource =
          new PropertiesPropertySource(LOCAL_PROPERTIES_PROPERTY_SOURCE_NAME, mergeProperties());
        if (this.localOverride) {
          this.propertySources.addFirst(localPropertySource);
        }
        else {
          this.propertySources.addLast(localPropertySource);
View Full Code Here

    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        if (propertyResolver == null) {
            try {
                MutablePropertySources sources = new MutablePropertySources();
                PropertySource<?> localPropertySource = new PropertiesPropertySource(EXTENDED_PROPERTIES_SOURCE, mergeProperties());
                sources.addLast(localPropertySource);

                propertyResolver = new PropertySourcesPropertyResolver(sources);

            } catch (IOException e) {
View Full Code Here

  }

  private void registerPropertySource(Properties properties) {
    int propertiesIndex = this.propertiesCounter.getAndIncrement();
    String propertySourceName = "properties-" + propertiesIndex;
    PropertySource<?> propertySource = new PropertiesPropertySource(propertySourceName, properties);
    this.context.getEnvironment().getPropertySources().addLast(propertySource);
  }
View Full Code Here

  }

  private void registerPropertySource(Properties properties) {
    int propertiesIndex = this.propertiesCounter.getAndIncrement();
    String propertySourceName = "properties-" + propertiesIndex;
    PropertySource<?> propertySource = new PropertiesPropertySource(propertySourceName, properties);
    this.propertySources.addLast(propertySource);
  }
View Full Code Here

      }
      else {
        zkProperties.put(ZK_CONNECT, zkClientConnect);
      }
      this.environment.getPropertySources().addFirst(
          new PropertiesPropertySource(ZK_PROPERTIES_SOURCE, zkProperties));
      ZooKeeperConnection zooKeeperConnection = new ZooKeeperConnection(zkClientConnect, zkNamespace);

      zooKeeperConnection.setAutoStartup(!zkConnectionConfigured);

      return zooKeeperConnection;
View Full Code Here

  @Override
  public void initialize(ConfigurableApplicationContext applicationContext) {
    Properties variables = new Properties();
    variables.put("variables", " baz  = BAZ,  car = CAR");
    applicationContext.getEnvironment().getPropertySources()
        .addLast(new PropertiesPropertySource("variables", variables));
  }
View Full Code Here

TOP

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

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.