Package org.springframework.beans.factory.config

Examples of org.springframework.beans.factory.config.PropertiesFactoryBean


  }

  @Override
  public YarnEnvironmentConfigurer propertiesLocationId(String id, String[] locations) throws IOException {
    for (String location : locations) {
      PropertiesFactoryBean fb = new PropertiesFactoryBean();
      fb.setLocation(new ClassPathResource(location));
      fb.afterPropertiesSet();
      getDataHolder(id).properties.putAll(fb.getObject());
    }
    return this;
  }
View Full Code Here


  @EnableYarn(enable=Enable.BASE)
  static class Config extends SpringYarnConfigurerAdapter {

    @Bean(name="props")
    public Properties getProperties() throws IOException {
      PropertiesFactoryBean fb = new PropertiesFactoryBean();
      fb.setLocation(new ClassPathResource("props.properties"));
      fb.afterPropertiesSet();
      return fb.getObject();
    }
View Full Code Here

  @EnableYarn(enable=Enable.BASE)
  static class Config extends SpringYarnConfigurerAdapter {

    @Bean(name="props")
    public Properties getProperties() throws IOException {
      PropertiesFactoryBean fb = new PropertiesFactoryBean();
      fb.setLocation(new ClassPathResource("props.properties"));
      fb.afterPropertiesSet();
      return fb.getObject();
    }
View Full Code Here

  @EnableYarn(enable=Enable.BASE)
  static class Config extends SpringYarnConfigurerAdapter {

    @Bean(name="props")
    public Properties getProperties() throws IOException {
      PropertiesFactoryBean fb = new PropertiesFactoryBean();
      fb.setLocation(new ClassPathResource("props.properties"));
      fb.afterPropertiesSet();
      return fb.getObject();
    }
View Full Code Here

  @EnableYarn(enable=Enable.BASE)
  static class Config extends SpringYarnConfigurerAdapter {

    @Bean(name="props")
    public Properties getProperties() throws IOException {
      PropertiesFactoryBean fb = new PropertiesFactoryBean();
      fb.setLocation(new ClassPathResource("props.properties"));
      fb.afterPropertiesSet();
      return fb.getObject();
    }
View Full Code Here

      return factory.getObject();
    }

    private NamedQueries namedQueries() throws IOException {

      PropertiesFactoryBean factory = new PropertiesFactoryBean();
      factory.setLocation(new ClassPathResource("META-INF/jpa-named-queries.properties"));
      factory.afterPropertiesSet();

      return new PropertiesBasedNamedQueries(factory.getObject());
    }
View Full Code Here

  @Bean
  public MessageSourceAccessor resourceDescriptionMessageSourceAccessor() {

    try {

      PropertiesFactoryBean propertiesFactoryBean = new PropertiesFactoryBean();
      propertiesFactoryBean.setLocation(new ClassPathResource("rest-default-messages.properties"));
      propertiesFactoryBean.afterPropertiesSet();

      ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
      messageSource.setBasename("classpath:rest-messages");
      messageSource.setCommonMessages(propertiesFactoryBean.getObject());

      return new MessageSourceAccessor(messageSource);

    } catch (Exception o_O) {
      throw new BeanCreationException("resourceDescriptionMessageSourceAccessor", "", o_O);
View Full Code Here

    pigTemplate = new PigTemplate(pigFactory.getObject());
  }

  private Properties loadProperties() throws Exception {
    if (StringUtils.hasText(propertiesLocation)) {
      PropertiesFactoryBean propsFactory = new PropertiesFactoryBean();
      propsFactory.setLocations(resourceResolver.getResources(propertiesLocation));
      propsFactory.afterPropertiesSet();
      return propsFactory.getObject();
    }

    return null;
  }
View Full Code Here

    params.put("jobExecutionId", "0");
    params.put("stepExecutionId", "0");

    RestTemplate template = new RestTemplate();

    PropertiesFactoryBean propertiesFactoryBean = new PropertiesFactoryBean();
    propertiesFactoryBean.setLocation(new ClassPathResource("/org/springframework/batch/admin/web/manager/json-resources.properties"));
    propertiesFactoryBean.afterPropertiesSet();
    Properties properties = propertiesFactoryBean.getObject();

    for (String path : properties.stringPropertyNames()) {
      if (!StringUtils.hasText(path) || !path.startsWith("GET")) {
        continue;
      }
View Full Code Here

    if (_properties != null && _targets.contains(beanName)) {
      if (obj instanceof Properties) {
        Properties properties = (Properties) obj;
        properties.putAll(_properties);
      } else if (obj instanceof PropertiesFactoryBean) {
        PropertiesFactoryBean factory = (PropertiesFactoryBean) obj;
        System.out.println(factory);
      }
    }

    return obj;
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.config.PropertiesFactoryBean

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.