Package org.springframework.beans.factory.config

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


    @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


   
    @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

        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

        ClassLoaderXmlPreprocessor classLoaderXmlPreprocessor = new ClassLoaderXmlPreprocessor(repository);
        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

                LoggingManager.initSimpleLoggingManagement();
                System.out.println("PORTAL: no log configuration found, simple log is used");
            }
           
            BeanFactory f = BeanFactoryHelper.getBeanFactory();
            PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
            Properties p = getProperties();
            ppc.setProperties(p);
            ppc.postProcessBeanFactory((ConfigurableListableBeanFactory)f);
            INSTANCE = (Portal)f.getBean("portal", Portal.class);
            INSTANCE.setServerServicesProvider(ServerServicesProvider.get(INSTANCE.getMasterServer()));
            UnifiedAuthentificationService.getInstance().setLoginInfo(p.getProperty("woj.server.user"), p.getProperty("woj.server.password"), getVersion());
            UnifiedAuthentificationService.getInstance().setUAK(INSTANCE.getUAK());
        }
View Full Code Here

            baseDir = System.getProperty("user.dir");
        }
        final String appRoot = baseDir+"/target/test-classes/webapp";
        final ApplicationContext bootContext = new ClassPathXmlApplicationContext(bootConfigurations, true);
        ctx = new ClassPathXmlApplicationContext(configurations, false, bootContext);
        PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
        Properties p = new Properties();
        p.setProperty(JetspeedEngineConstants.APPLICATION_ROOT_KEY, appRoot);
        ppc.setProperties(p);
        ctx.addBeanFactoryPostProcessor(ppc);
        ctx.refresh();

        // access page manager
        pageManager = (PageManager)ctx.getBean("pageManager");
View Full Code Here

        configureConnectors();
        configureWebContext();
    }

    private void configureParentContext() {
        PropertyPlaceholderConfigurer config = new PropertyPlaceholderConfigurer();
        config.setProperties(buildProperties());
        context = new ClassPathXmlApplicationContext();
        context.addBeanFactoryPostProcessor(config);
        context.setConfigLocation(SoapServerConstants.SPRING_CONTEXT_LOCATION);
        context.refresh();
        context.registerShutdownHook();
View Full Code Here

     
      for(Resource propertyResource : propertyResources) {
        properties.load(propertyResource.getInputStream());
      }
     
      PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
      configurer.setLocations(propertyResources);
      context.addBeanFactoryPostProcessor(configurer);
    }
  }
View Full Code Here

        testUtilities.addDefaultNamespaces();
    }
   
    public void additionalSpringConfiguration(GenericApplicationContext applicationContext) throws Exception {
        // 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());       
    }
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.