code: public void postProcessBeanFactory(final ConfigurableListableBeanFactory beanFactory) throws BeansException {
  
  		if (beanFactory == null) {
  			return;
  		}
  
  		String[] beanNames = beanFactory.getBeanDefinitionNames();
  		int singletonBeanCount = 0;
  
  		for (int i = 0; i < beanNames.length; i++) {
  			// using beanDefinition to check singleton property because when
  			// accessing through
  			// context (applicationContext.isSingleton(beanName)), bean will be
  			// created already,
  			// possibly bypassing other BeanFactoryPostProcessors
  			BeanDefinition beanDefinition = beanFactory.getBeanDefinition(beanNames[i]);
  
  			if (beanDefinition.isSingleton()) {
  				singletonBeanCount++;
  			}
  
  		}
  
  		this.progressMonitor.taskStarted(this.loadingAppContextMessage, singletonBeanCount);
  
  		beanFactory.addBeanPostProcessor(new ProgressMonitoringBeanPostProcessor(beanFactory));
  
  	}
docs: Notifies this instance's associated progress monitor of progress made
  while processing the given bean factory.
  
  @param beanFactory the bean factory that is to be processed.