Example usage for org.springframework.beans.factory.support DefaultListableBeanFactory isAllowEagerClassLoading

List of usage examples for org.springframework.beans.factory.support DefaultListableBeanFactory isAllowEagerClassLoading

Introduction

In this page you can find the example usage for org.springframework.beans.factory.support DefaultListableBeanFactory isAllowEagerClassLoading.

Prototype

public boolean isAllowEagerClassLoading() 

Source Link

Document

Return whether the factory is allowed to eagerly load bean classes even for bean definitions that are marked as "lazy-init".

Usage

From source file:lodsve.core.condition.BeanTypeRegistry.java

/**
 * Factory method to get the {@link BeanTypeRegistry} for a given {@link BeanFactory}.
 *
 * @param beanFactory the source bean factory
 * @return the {@link BeanTypeRegistry} for the given bean factory
 *///from   ww w . j ava  2s.  co m
public static BeanTypeRegistry get(ListableBeanFactory beanFactory) {
    if (beanFactory instanceof DefaultListableBeanFactory) {
        DefaultListableBeanFactory listableBeanFactory = (DefaultListableBeanFactory) beanFactory;
        if (listableBeanFactory.isAllowEagerClassLoading()) {
            return OptimizedBeanTypeRegistry.getFromFactory(listableBeanFactory);
        }
    }
    return new DefaultBeanTypeRegistry(beanFactory);
}