Example usage for org.springframework.context.support PropertySourcesPlaceholderConfigurer PropertySourcesPlaceholderConfigurer

List of usage examples for org.springframework.context.support PropertySourcesPlaceholderConfigurer PropertySourcesPlaceholderConfigurer

Introduction

In this page you can find the example usage for org.springframework.context.support PropertySourcesPlaceholderConfigurer PropertySourcesPlaceholderConfigurer.

Prototype

PropertySourcesPlaceholderConfigurer

Source Link

Usage

From source file:de.thm.arsnova.config.ExtraConfig.java

@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
    final PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer();
    configurer.setLocations(new Resource[] { new ClassPathResource("arsnova.properties.example"),
            new FileSystemResource("/etc/arsnova/arsnova.properties"), });
    configurer.setIgnoreResourceNotFound(true);
    configurer.setIgnoreUnresolvablePlaceholders(false);
    return configurer;
}

From source file:se.ivankrizsan.messagecowboy.MessageCowboyConfiguration.java

/**
 * This bean is required in order for the property values loaded by the
 * @PropertySource annotation to become available when injecting
 * property values using the @Value annotation.
 *///from  ww  w .  j av  a  2 s . co m
@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
    PropertySourcesPlaceholderConfigurer thePropertyPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
    thePropertyPlaceholderConfigurer.setIgnoreUnresolvablePlaceholders(true);
    return thePropertyPlaceholderConfigurer;
}

From source file:org.opentestsystem.authoring.testspecbank.client.config.TestClientIntegratedConfigScanner.java

@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
    return new PropertySourcesPlaceholderConfigurer() {

        @Override/* ww w  .  j  ava2 s  . c  o m*/
        protected Properties mergeProperties() throws IOException {
            Properties props = super.mergeProperties();
            props.put("tsb.tsbUrl", "http://go.no.where");
            return props;
        }
    };
}

From source file:dk.nsi.haiba.epimibaimporter.integrationtest.EPIMIBAIntegrationTestConfiguration.java

@Bean
public static PropertySourcesPlaceholderConfigurer properties() {
    return new PropertySourcesPlaceholderConfigurer();
}

From source file:org.shaigor.rest.retro.service.impl.WordsSereviceTestConfig.java

@Bean
public PropertySourcesPlaceholderConfigurer properties() {
    PropertySourcesPlaceholderConfigurer ppc = new PropertySourcesPlaceholderConfigurer();
    ppc.setLocalOverride(true);//from  w  ww.ja  v  a  2 s.  co  m
    String filenamePrefix = determineFilename("words").startsWith(SRC_PATH) ? "src." : "classes.";
    org.springframework.core.io.Resource[] resources = new ClassPathResource[] {
            new ClassPathResource(filenamePrefix + WORDS_SERVICE_PROPERTIES) };
    ppc.setLocations(resources);
    return ppc;
}

From source file:io.pivotal.example.app.bootstrap.config.ExampleApplicationGemFireConfiguration.java

@Bean
PropertySourcesPlaceholderConfigurer propertyPlaceholderConfigurer() {
    return new PropertySourcesPlaceholderConfigurer();
}

From source file:net.bluewizardhat.tfa.web.config.PropertySourcesConfigurer.java

@Bean
public PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
    PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer();
    configurer.setEnvironment(env);//w ww  .  j a v a  2 s. co  m
    return configurer;
}

From source file:it.cnr.missioni.connector.core.spring.placeholder.MissioniCorePlaceholderConfig.java

@Bean
public static PropertySourcesPlaceholderConfigurer oauth2CorePropertyConfigurer(
        @Value("#{systemProperties['GP_DATA_DIR']}") String gpConfigDataDir,
        @Value("#{systemProperties['MISSIONI_CORE_FILE_PROP']}") String missioniCoreFileProp)
        throws MalformedURLException {

    PropertySourcesPlaceholderConfigurer corePC = new PropertySourcesPlaceholderConfigurer();
    corePC.setPlaceholderPrefix("missioniCoreConfigurator{");
    corePC.setPlaceholderSuffix("}");
    corePC.setNullValue("@null");

    corePC.setLocations(placeholderResourcesLoader.loadResources(gpConfigDataDir, missioniCoreFileProp));
    corePC.setIgnoreResourceNotFound(Boolean.TRUE);
    corePC.setIgnoreUnresolvablePlaceholders(Boolean.TRUE);

    return corePC;
}

From source file:org.geosdi.geoplatform.experimental.connector.core.spring.placeholder.OAuth2CorePlaceholderConfig.java

@Bean
public static PropertySourcesPlaceholderConfigurer oauth2CorePropertyConfigurer(
        @Value("#{systemProperties['GP_DATA_DIR']}") String gpConfigDataDir,
        @Value("#{systemProperties['OAUTH2_CORE_FILE_PROP']}") String oauth2CoreFileProp)
        throws MalformedURLException {

    PropertySourcesPlaceholderConfigurer corePC = new PropertySourcesPlaceholderConfigurer();
    corePC.setPlaceholderPrefix("oauth2CoreConfigurator{");
    corePC.setPlaceholderSuffix("}");
    corePC.setNullValue("@null");

    corePC.setLocations(placeholderResourcesLoader.loadResources(gpConfigDataDir, oauth2CoreFileProp));
    corePC.setIgnoreResourceNotFound(Boolean.TRUE);
    corePC.setIgnoreUnresolvablePlaceholders(Boolean.TRUE);

    return corePC;
}

From source file:occi.config.SpringOcciConfig.java

@Bean
public static PropertySourcesPlaceholderConfigurer properties() {
    PropertySourcesPlaceholderConfigurer pspc = new PropertySourcesPlaceholderConfigurer();
    Resource[] resources = new ClassPathResource[] { new ClassPathResource("OCCI.properties") };
    pspc.setLocations(resources);/*from w  w  w  .  j av  a2  s. c  om*/
    pspc.setIgnoreUnresolvablePlaceholders(true);
    return pspc;
}