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

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

Introduction

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

Prototype

@Nullable
ClassLoader getTempClassLoader();

Source Link

Document

Return the temporary ClassLoader to use for type matching purposes, if any.

Usage

From source file:org.springframework.context.support.AbstractApplicationContext.java

/**
 * Instantiate and invoke all registered BeanFactoryPostProcessor beans,
 * respecting explicit order if given.//from  www  . j a va  2 s .  c o  m
 * <p>Must be called before singleton instantiation.
 */
protected void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory) {
    PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(beanFactory,
            getBeanFactoryPostProcessors());

    // Detect a LoadTimeWeaver and prepare for weaving, if found in the meantime
    // (e.g. through an @Bean method registered by ConfigurationClassPostProcessor)
    if (beanFactory.getTempClassLoader() == null && beanFactory.containsBean(LOAD_TIME_WEAVER_BEAN_NAME)) {
        beanFactory.addBeanPostProcessor(new LoadTimeWeaverAwareProcessor(beanFactory));
        beanFactory.setTempClassLoader(new ContextTypeMatchClassLoader(beanFactory.getBeanClassLoader()));
    }
}