Package org.springframework.beans.factory.config

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


    @Override public String getContextConfigLocation() {
        return IWebMvcDispatcherServlet.DISPATCHER_CONTEXT;
    }

    @Override protected void postProcessWebApplicationContext(ConfigurableWebApplicationContext wac) {
        wac.addBeanFactoryPostProcessor(new BeanFactoryPostProcessor() {
            @Override
            public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
                BeanFactoryPostProcessor pp = (BeanFactoryPostProcessor) beanFactory.getBean(IWebMvcDispatcherServlet.RESOLVER, PropertyPlaceholderConfigurer.class);
                pp.postProcessBeanFactory(beanFactory);
            }
        });
    }
View Full Code Here


    FileSystemXmlApplicationContext context = new FileSystemXmlApplicationContext(
       new String[] { "file:///" + explodedServiceUnitRoot.getAbsolutePath() + "/" + getXBeanFile() },
           false);
        List beanFactoryPostProcessors = getBeanFactoryPostProcessors(explodedServiceUnitRoot.getAbsolutePath());
        for (Iterator iter = beanFactoryPostProcessors.iterator(); iter.hasNext();) {
            BeanFactoryPostProcessor processor = (BeanFactoryPostProcessor) iter.next();
            context.addBeanFactoryPostProcessor(processor);
        }
        context.refresh();
    for (int i = 0; i < context.getBeanDefinitionNames().length; i++) {
      Object bean = context.getBean(context.getBeanDefinitionNames()[i]);
View Full Code Here

   * <p>Must be called before singleton instantiation.
   */
  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);
    }
  }
View Full Code Here

        return true;
    }

    protected List getBeanFactoryPostProcessors(String serviceUnitRootPath) {
        List processors = new ArrayList(super.getBeanFactoryPostProcessors(serviceUnitRootPath));
        processors.add(new BeanFactoryPostProcessor() {
            public void postProcessBeanFactory(ConfigurableListableBeanFactory factory) throws BeansException {
                Map beans = new HashMap();
                beans.put("context", new EndpointComponentContext(((BaseLifeCycle) component.getLifeCycle()).getContext()));
                BeanFactory parent = new SimpleBeanFactory(beans);
                factory.setParentBeanFactory(parent);
View Full Code Here

      log.debug("Ignoring bundle " + bundleString + " as it's Spring incompatible with Spring-DM...");
      return;
    }

    // create a dedicated hook for this application context
    BeanFactoryPostProcessor processingHook = new OsgiBeanFactoryPostProcessorAdapter(localBundleContext,
      postProcessors);

    // add in the post processors
    localApplicationContext.addBeanFactoryPostProcessor(processingHook);
View Full Code Here

      wac.setConfigLocations(
          StringUtils.tokenizeToStringArray(
              getContextConfigLocation(), ConfigurableWebApplicationContext.CONFIG_LOCATION_DELIMITERS));
    }
    wac.addBeanFactoryPostProcessor(
        new BeanFactoryPostProcessor() {
          public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
            beanFactory.addBeanPostProcessor(new ActionServletAwareProcessor(getActionServlet()));
            beanFactory.ignoreDependencyType(ActionServlet.class);
          }
        }
View Full Code Here

   * <p>Must be called before singleton instantiation.
   */
  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);
    }
  }
View Full Code Here

   * <p>Must be called before singleton instantiation.
   */
  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

TOP

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

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.