Package org.springframework.beans.factory.config

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


        if (includeService) {
            readBeans(new ClassPathResource("server-lifecycle-beans.xml", getClass()));
        }
       
        // bring in some property values from a Properties file
        PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();
        Properties properties = new Properties();
        properties.setProperty("staticResourceURL", getStaticResourceURL());
        cfg.setProperties(properties);
        // now actually do the replacement
        cfg.postProcessBeanFactory(applicationContext.getBeanFactory());       
        applicationContext.refresh();
    }
View Full Code Here


        if (includeService) {
            readBeans(new ClassPathResource("server-lifecycle-beans.xml", getClass()));
        }
       
        // bring in some property values from a Properties file
        PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();
        Properties properties = new Properties();
        properties.setProperty("staticResourceURL", getStaticResourceURL());
        cfg.setProperties(properties);
        // now actually do the replacement
        cfg.postProcessBeanFactory(applicationContext.getBeanFactory());       
        applicationContext.refresh();
    }
View Full Code Here

        if (includeService) {
            readBeans(new ClassPathResource("server-lifecycle-beans.xml", getClass()));
        }
       
        // bring in some property values from a Properties file
        PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();
        Properties properties = new Properties();
        properties.setProperty("staticResourceURL", getStaticResourceURL());
        cfg.setProperties(properties);
        // now actually do the replacement
        cfg.postProcessBeanFactory(applicationContext.getBeanFactory());       
        applicationContext.refresh();
    }
View Full Code Here

    private void setupAndRun(Properties jbNodeProperties, String[] modules) {
        logger.log(Level.INFO, "Setting up Spring contexts");

        ApplicationContext rootContext = new ClassPathXmlApplicationContext(new String[] {JBNODE_PROPERTIES_XML});

        PropertyPlaceholderConfigurer propertyPlaceholderConfigurer =
                (PropertyPlaceholderConfigurer)rootContext.getBean("jbNodePropertyPlaceholder");
        propertyPlaceholderConfigurer.setProperties(jbNodeProperties);

        ClassPathXmlApplicationContext mainContext = new ClassPathXmlApplicationContext(
                rootContext
        );
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

        ClassLoaderXmlPreprocessor classLoaderXmlPreprocessor = new ClassLoaderXmlPreprocessor(repository, container);
        return Collections.singletonList(classLoaderXmlPreprocessor);
    }
   
    protected List getBeanFactoryPostProcessors(String serviceUnitRootPath) {
        PropertyPlaceholderConfigurer propertyPlaceholder = new PropertyPlaceholderConfigurer();
        FileSystemResource propertiesFile = new FileSystemResource(
                new File(serviceUnitRootPath) + "/" + getXBeanFile()
                        + ".properties");
        if (propertiesFile.getFile().exists()) {               
            propertyPlaceholder.setLocation(propertiesFile);
            return Collections.singletonList(propertyPlaceholder);
        }
        return Collections.EMPTY_LIST;
    }
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

        if (includeService) {
            readBeans(new ClassPathResource("server-lifecycle-beans.xml", getClass()));
        }
       
        // bring in some property values from a Properties file
        PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();
        Properties properties = new Properties();
        properties.setProperty("staticResourceURL", getStaticResourceURL());
        cfg.setProperties(properties);
        // now actually do the replacement
        cfg.postProcessBeanFactory(applicationContext.getBeanFactory());       
        applicationContext.refresh();
    }
View Full Code Here

                printMissingOption("c");
                printHelp();
                System.exit(-1);
            }

            PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
            configurer.setProperties(commandLineProperties);
            XmlBeanFactory factoryBean = new XmlBeanFactory(new ClassPathResource("com/alphacsp/cit/context/applicationContext.xml"));
            configurer.postProcessBeanFactory(factoryBean);

            UserInterface userInterface = (UserInterface) factoryBean.getBean("userInterface");
            userInterface.start();

            Interperter interperter = (Interperter) factoryBean.getBean("interperter");
View Full Code Here

TOP

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

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.