Package org.springframework.beans.factory.config

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


  public void testFactoryBeansWithAutowiring() throws Exception {
    DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
    new XmlBeanDefinitionReader(factory).loadBeanDefinitions(WITH_AUTOWIRING_CONTEXT);

    BeanFactoryPostProcessor ppc = (BeanFactoryPostProcessor) factory.getBean("propertyPlaceholderConfigurer");
    ppc.postProcessBeanFactory(factory);

    Alpha alpha = (Alpha) factory.getBean("alpha");
    Beta beta = (Beta) factory.getBean("beta");
    Gamma gamma = (Gamma) factory.getBean("gamma");
    Gamma gamma2 = (Gamma) factory.getBean("gammaFactory");
View Full Code Here


  public void testFactoryBeansWithIntermediateFactoryBeanAutowiringFailure() throws Exception {
    DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
    new XmlBeanDefinitionReader(factory).loadBeanDefinitions(WITH_AUTOWIRING_CONTEXT);

    BeanFactoryPostProcessor ppc = (BeanFactoryPostProcessor) factory.getBean("propertyPlaceholderConfigurer");
    ppc.postProcessBeanFactory(factory);

    Beta beta = (Beta) factory.getBean("beta");
    Alpha alpha = (Alpha) factory.getBean("alpha");
    Gamma gamma = (Gamma) factory.getBean("gamma");
    assertSame(beta, alpha.getBeta());
View Full Code Here

   */
  protected void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory) {
    // Invoke factory processors registered with the context instance.
    for (Iterator it = getBeanFactoryPostProcessors().iterator(); it.hasNext();) {
      BeanFactoryPostProcessor factoryProcessor = (BeanFactoryPostProcessor) it.next();
      factoryProcessor.postProcessBeanFactory(beanFactory);
    }

    // Do not initialize FactoryBeans here: We need to leave all regular beans
    // uninitialized to let the bean factory post-processors apply to them!
    String[] postProcessorNames =
View Full Code Here

   * Invoke the given BeanFactoryPostProcessor beans.
   */
  private void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory, List postProcessors) {
    for (Iterator it = postProcessors.iterator(); it.hasNext();) {
      BeanFactoryPostProcessor postProcessor = (BeanFactoryPostProcessor) it.next();
      postProcessor.postProcessBeanFactory(beanFactory);
    }
  }

  /**
   * Instantiate and invoke all registered BeanPostProcessor beans,
View Full Code Here

    // Invoke factory processors registered with the context instance.
    for (Iterator it = getBeanFactoryPostProcessors().iterator(); it.hasNext();) {
      BeanFactoryPostProcessor factoryProcessor = (BeanFactoryPostProcessor) it.next();
      // check the exclude type
      if (type.isInstance(factoryProcessor) && (exclude == null || !exclude.isInstance(factoryProcessor))) {
        factoryProcessor.postProcessBeanFactory(beanFactory);
      }
    }

    // Do not initialize FactoryBeans here: We need to leave all regular
    // beans uninitialized to let the bean factory post-processors apply to
View Full Code Here

   * @param postProcessors
   */
  private void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory, List postProcessors) {
    for (Iterator it = postProcessors.iterator(); it.hasNext();) {
      BeanFactoryPostProcessor postProcessor = (BeanFactoryPostProcessor) it.next();
      postProcessor.postProcessBeanFactory(beanFactory);
    }
  }

  // customized to handle DependencyInitializationAwareBeanPostProcessor
  // 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.