org.springframework.beans.factory.BeanClassLoaderAware

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.
 *
 * 

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. * *

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. *

Invoked after the population of normal bean properties but * before 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); }

简介

org.springframework.beans.factory.Aware 的一个子接口。

文档

允许 bean 知道 bean ClassLoader 的回调;即当前 bean工厂 加载 bean类
使用的类加载器。
这主要是由框架类实现的,尽管应用程序类可能是从共享的类加载器加载的,但框架类必须按名称选择它们。

有关所有 bean生命周期 方法的列表,请参见 BeanFactory javadocs

你可能感兴趣的:(org.springframework.beans.factory.BeanClassLoaderAware)