package org.springframework.beans.factory;
/**
* Callback that allows a bean to be aware of the bean
* {@link ClassLoader class loader}; that is, the class loader used by the
* present bean factory to load bean classes.
*
* <p>This is mainly intended to be implemented by framework classes which
* have to pick up application classes by name despite themselves potentially
* being loaded from a shared class loader.
*
* <p>For a list of all bean lifecycle methods, see the
* {@link BeanFactory BeanFactory javadocs}.
*
* @author Juergen Hoeller
* @author Chris Beams
* @since 2.0
* @see BeanNameAware
* @see BeanFactoryAware
* @see InitializingBean
*/
public interface BeanClassLoaderAware extends Aware {
/**
* Callback that supplies the bean {@link ClassLoader class loader} to
* a bean instance.
* <p>Invoked <i>after</i> the population of normal bean properties but
* <i>before</i> an initialization callback such as
* {@link InitializingBean InitializingBean's}
* {@link InitializingBean#afterPropertiesSet()}
* method or a custom init-method.
* @param classLoader the owning class loader
*/
void setBeanClassLoader(ClassLoader classLoader);
}
簡(jiǎn)介
org.springframework.beans.factory.Aware
的一個(gè)子接口。
文檔
允許 bean
知道 bean ClassLoader
的回調(diào);即當(dāng)前 bean工廠
加載 bean類
使用的類加載器。
這主要是由框架類實(shí)現(xiàn)的,盡管應(yīng)用程序類可能是從共享的類加載器加載的,但框架類必須按名稱選擇它們。
有關(guān)所有 bean生命周期
方法的列表,請(qǐng)參見 BeanFactory javadocs
。