Example usage for org.springframework.beans.factory.config ConfigurableBeanFactory isCurrentlyInCreation

List of usage examples for org.springframework.beans.factory.config ConfigurableBeanFactory isCurrentlyInCreation

Introduction

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

Prototype

boolean isCurrentlyInCreation(String beanName);

Source Link

Document

Determine whether the specified bean is currently in creation.

Usage

From source file:org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.java

/**
 * Resolves the specified interceptor names to Advisor objects.
 * @see #setInterceptorNames//from   w  ww .  ja  v a2s . com
 */
private Advisor[] resolveInterceptorNames() {
    BeanFactory bf = this.beanFactory;
    ConfigurableBeanFactory cbf = (bf instanceof ConfigurableBeanFactory ? (ConfigurableBeanFactory) bf : null);
    List<Advisor> advisors = new ArrayList<>();
    for (String beanName : this.interceptorNames) {
        if (cbf == null || !cbf.isCurrentlyInCreation(beanName)) {
            Assert.state(bf != null, "BeanFactory required for resolving interceptor names");
            Object next = bf.getBean(beanName);
            advisors.add(this.advisorAdapterRegistry.wrap(next));
        }
    }
    return advisors.toArray(new Advisor[advisors.size()]);
}