SpringModelMBean.java 文件源码

java
阅读 33 收藏 0 点赞 0 评论 0

项目:lams 作者:
/**
 * Switches the {@link Thread#getContextClassLoader() context ClassLoader} for the
 * managed resources {@link ClassLoader} before allowing the invocation to occur.
 * @see javax.management.modelmbean.ModelMBean#setAttribute
 */
@Override
public void setAttribute(Attribute attribute)
        throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException {

    ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
    try {
        Thread.currentThread().setContextClassLoader(this.managedResourceClassLoader);
        super.setAttribute(attribute);
    }
    finally {
        Thread.currentThread().setContextClassLoader(currentClassLoader);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号