Example usage for org.springframework.beans.factory.config ConfigurableListableBeanFactory getBeanDefinitionCount

List of usage examples for org.springframework.beans.factory.config ConfigurableListableBeanFactory getBeanDefinitionCount

Introduction

In this page you can find the example usage for org.springframework.beans.factory.config ConfigurableListableBeanFactory getBeanDefinitionCount.

Prototype

int getBeanDefinitionCount();

Source Link

Document

Return the number of beans defined in the factory.

Usage

From source file:org.excalibur.service.spring.config.DBIBeanFactoryPostprocessor.java

@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
    int beanDefinitionCount = beanFactory.getBeanDefinitionCount();
    //        beanFactory.addBeanPostProcessor(new BeanPostProcessor()
    //        {// w  w w .  ja  v  a 2 s .co  m
    //            @Override
    //            public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException
    //            {
    //                System.out.println(beanName);
    //                return bean;
    //            }
    //            
    //            @Override
    //            public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException
    //            {
    //                System.out.println(beanName);
    //                return bean;
    //            }
    //        });

    System.out.println(beanDefinitionCount);
}

From source file:org.pentaho.platform.engine.core.system.objfac.spring.PentahoBeanScopeValidatorPostProcessor.java

@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {

    if (beanFactory != null && beanFactory.getBeanDefinitionCount() > 0) {

        for (String beanName : beanFactory.getBeanDefinitionNames()) {

            validateBeanScope(beanName, beanFactory.getBeanDefinition(beanName));

        }/*from   w  ww  .j  av  a2 s  .  c  o  m*/
    }
}