Examples of postProcessBeanFactory()


Examples of org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.postProcessBeanFactory()

    PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
    Properties props = new Properties();
    props.setProperty("tb", "testBean4");
    ppc.setProperties(props);
    ppc.postProcessBeanFactory(bf);

    ExtendedResourceInjectionBean bean = (ExtendedResourceInjectionBean) bf.getBean("annotatedBean");
    INestedTestBean tb = bean.getTestBean6();
    assertNotNull(tb);
View Full Code Here

Examples of org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.postProcessBeanFactory()

    PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
    Properties props = new Properties();
    props.setProperty("tb", "testBean3");
    ppc.setProperties(props);
    ppc.postProcessBeanFactory(bf);

    bf.registerBeanDefinition("annotatedBean", new RootBeanDefinition(ExtendedResourceInjectionBean.class));
    bf.registerBeanDefinition("annotatedBean2", new RootBeanDefinition(NamedResourceInjectionBean.class));
    bf.registerBeanDefinition("annotatedBean3", new RootBeanDefinition(ConvertedResourceInjectionBean.class));
    TestBean tb = new TestBean();
View Full Code Here

Examples of org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.postProcessBeanFactory()

    PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
    Properties props = new Properties();
    props.setProperty("tb", "testBean3");
    ppc.setProperties(props);
    ppc.postProcessBeanFactory(bf);

    RootBeanDefinition annotatedBd = new RootBeanDefinition(ExtendedResourceInjectionBean.class);
    TestBean tb5 = new TestBean();
    annotatedBd.getPropertyValues().add("testBean2", tb5);
    bf.registerBeanDefinition("annotatedBean", annotatedBd);
View Full Code Here

Examples of org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.postProcessBeanFactory()

    beanReader.loadBeanDefinitions(connectorDefaultsConfig);
    Properties props = new Properties();
    props.putAll(config);
    PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
    configurer.setProperties(props);
    configurer.postProcessBeanFactory(factory);
    return (Connector) factory.getBean("Filenet_P8");
  }
}
View Full Code Here

Examples of org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.postProcessBeanFactory()

        DEFAULTS_CONFIG_FILE, ConfigTest.class));
    reader.loadBeanDefinitions(new ClassPathResource(
        INSTANCE_CONFIG_FILE, ConfigTest.class));
    PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();
    cfg.setProperties(props);
    cfg.postProcessBeanFactory(beanFactory);
    String[] beans = beanFactory.getBeanNamesForType(Connector.class);
    assertEquals(1, beans.length);
    Object obj = beanFactory.getBean(beans[0]);
    assertTrue("Expecting instance of Connector interface but the actual "
        + "instance: " + obj.getClass().toString(), obj instanceof Connector);
View Full Code Here

Examples of org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.postProcessBeanFactory()

        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();
    }
   
    private void invokeService() {       
        DummyInterface client = (DummyInterface) applicationContext.getBean("dummy-client");
View Full Code Here

Examples of org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.postProcessBeanFactory()

      throw new RepositoryException(e);
    }

    PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();
    cfg.setProperties(props);
    cfg.postProcessBeanFactory(factory);

    String[] beanList = factory.getBeanNamesForType(DiffingConnector.class);
    Assert.assertEquals(Arrays.asList(beanList).toString(), 1, beanList.length);
    return (Connector) factory.getBean(beanList[0]);
  }
View Full Code Here

Examples of org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory()

  private AbstractBeanDefinition beanDef(Class<?> configClass) {
    DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
    factory.registerBeanDefinition("config", new RootBeanDefinition(configClass));
    ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
    pp.postProcessBeanFactory(factory);
    return (AbstractBeanDefinition) factory.getBeanDefinition("foo");
  }

}
View Full Code Here

Examples of org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory()

      String configBeanName = configClass.getName();
      factory.registerBeanDefinition(configBeanName, new RootBeanDefinition(configClass));
    }
    ConfigurationClassPostProcessor ccpp = new ConfigurationClassPostProcessor();
    ccpp.postProcessBeanDefinitionRegistry(factory);
    ccpp.postProcessBeanFactory(factory);
    RequiredAnnotationBeanPostProcessor rapp = new RequiredAnnotationBeanPostProcessor();
    rapp.setBeanFactory(factory);
    factory.addBeanPostProcessor(rapp);
    factory.freezeConfiguration();
    return factory;
View Full Code Here

Examples of org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory()

    DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
    for (Class<?> clazz : classes) {
      beanFactory.registerBeanDefinition(clazz.getSimpleName(), new RootBeanDefinition(clazz));
    }
    ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
    pp.postProcessBeanFactory(beanFactory);
    return beanFactory;
  }

  private void assertBeanDefinitionCount(int expectedCount, Class<?>... classes) {
    DefaultListableBeanFactory beanFactory = processConfigurationClasses(classes);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.