Package org.springframework.beans.factory.config

Examples of org.springframework.beans.factory.config.PropertyPlaceholderConfigurer$PlaceholderResolvingStringValueResolver


        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory);
        Resource resource = new ClassPathResource(classpath);
        reader.loadBeanDefinitions(resource);
       
        // apply the properties to the context
        PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
        configurer.setProperties(properties);
        configurer.setIgnoreUnresolvablePlaceholders(false);
        configurer.setIgnoreResourceNotFound(false);
        configurer.setSystemPropertiesMode(PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_FALLBACK);
        configurer.postProcessBeanFactory(beanFactory);
       
        return beanFactory;
    }
View Full Code Here


    @Before
    public void createSpringContext() {
        try {
            log.info( "creating spring context" );
            PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
            Properties properties = new Properties();
            properties.setProperty( "temp.dir",
                                    TMPDIR );
            configurer.setProperties( properties );
            ctx = new ClassPathXmlApplicationContext();
            ctx.addBeanFactoryPostProcessor( configurer );
            ctx.setConfigLocation( "org/drools/container/spring/beans/persistence/beans.xml" );
            ctx.refresh();
        } catch ( Exception e ) {
View Full Code Here

    @Before
    public void createSpringContext() {
        try {
            log.info( "creating spring context" );
            PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
            Properties properties = new Properties();
            properties.setProperty( "temp.dir",
                                    TMPDIR );
            configurer.setProperties( properties );
            ctx = new ClassPathXmlApplicationContext();
            ctx.addBeanFactoryPostProcessor( configurer );
            ctx.setConfigLocation( "org/drools/container/spring/beans/persistence/beansVarPersistence.xml" );
            ctx.refresh();
        } catch ( Exception e ) {
View Full Code Here

        final DefaultListableBeanFactory beanFactory = createBeanFactory();
        final GenericApplicationContext context = new GenericApplicationContext(beanFactory);
        context.registerShutdownHook();

        final PropertyPlaceholderConfigurer propertyPlaceholderConfigurer = new PropertyPlaceholderConfigurer();
        propertyPlaceholderConfigurer.setSystemPropertiesMode(PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE);

        if (properties != null) {
            if (properties instanceof Resource)
                propertyPlaceholderConfigurer.setLocation((Resource) properties);
            else if (properties instanceof Properties)
                propertyPlaceholderConfigurer.setProperties((Properties) properties);
            else
                throw new IllegalArgumentException("Properties argument - " + properties + " - is of an unhandled type");
        }
        context.addBeanFactoryPostProcessor(propertyPlaceholderConfigurer);
View Full Code Here

    @Before
    public void createSpringContext() {
        try {
            log.info( "creating spring context" );
            PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
            Properties properties = new Properties();
            properties.setProperty( "temp.dir",
                                    TMPDIR );
            configurer.setProperties(properties);
            ctx = new ClassPathXmlApplicationContext();
            ctx.addBeanFactoryPostProcessor( configurer );
            //ctx.setConfigLocation( "org/drools/container/spring/beans/persistence/beansVarPersistence.xml" );
            ctx.setConfigLocation( "org/drools/container/spring/beans/persistence/beansVarPersistence_Env.xml" );
            ctx.refresh();
View Full Code Here

    @Before
    public void createSpringContext() {
        try {
            log.info( "creating spring context" );
            PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
            Properties properties = new Properties();
            properties.setProperty( "temp.dir",
                                    TMPDIR );
            configurer.setProperties( properties );
            ctx = new ClassPathXmlApplicationContext();
            ctx.addBeanFactoryPostProcessor( configurer );
            //ctx.setConfigLocation( "org/drools/container/spring/beans/persistence/beans.xml" );
            ctx.setConfigLocation( "org/drools/container/spring/beans/persistence/beans_Env.xml" );
            ctx.refresh();
View Full Code Here

        final DefaultListableBeanFactory beanFactory = createBeanFactory();
        final GenericApplicationContext context = new GenericApplicationContext(beanFactory);
        context.registerShutdownHook();

        if (properties != null) {
            final PropertyPlaceholderConfigurer propertyPlaceholderConfigurer = new PropertyPlaceholderConfigurer();
            propertyPlaceholderConfigurer.setSystemPropertiesMode(PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE);
            if(properties instanceof Resource)
                propertyPlaceholderConfigurer.setLocation((Resource)properties);
            else if(properties instanceof Properties)
                propertyPlaceholderConfigurer.setProperties((Properties)properties);
            else
                throw new IllegalArgumentException("Properties argument - " + properties + " - is of an unhandled type");
            context.addBeanFactoryPostProcessor(propertyPlaceholderConfigurer);
        }
View Full Code Here

  }
    public PropertyConfigurer(EncryptorRegistry registry) {
        this(registry.getEncryptor());
    }
  protected PropertyConfigurer(StringEncryptor encryptor) {
    this.propertyPlaceholderConfigurer = encryptor != null ? new EncryptablePropertyPlaceholderConfigurer(encryptor) : new PropertyPlaceholderConfigurer();

    // Ensure that system properties override the spring-set properties.
    propertyPlaceholderConfigurer.setSystemPropertiesMode(PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE);

    PropertiesPersister savingPropertiesPersister = new DefaultPropertiesPersister() {
View Full Code Here

    @Before
    public void createSpringContext() {
        try {
            log.info( "creating spring context" );
            PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
            Properties properties = new Properties();
            properties.setProperty( "temp.dir",
                                    TMPDIR );
            configurer.setProperties( properties );
            ctx = new ClassPathXmlApplicationContext();
            ctx.addBeanFactoryPostProcessor( configurer );
            ctx.setConfigLocation( "org/drools/container/spring/timer/conf/spring-conf.xml" );
            ctx.refresh();
        } catch ( Exception e ) {
View Full Code Here

    @Before
    public void createSpringContext() {
        try {
            log.info( "creating spring context" );
            PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
            Properties properties = new Properties();
            properties.setProperty( "temp.dir",
                                    TMPDIR );
            configurer.setProperties( properties );
            ctx = new ClassPathXmlApplicationContext();
            ctx.addBeanFactoryPostProcessor( configurer );
            ctx.setConfigLocation( "org/drools/container/spring/beans/persistence/beans.xml" );
            ctx.refresh();
        } catch ( Exception e ) {
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.config.PropertyPlaceholderConfigurer$PlaceholderResolvingStringValueResolver

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.