DefaultMBeanServerInterceptor.java 文件源码

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

项目:OpenJSharp 作者:
/**
 * Registers a ClassLoader with the CLR.
 * This method is called by the ResourceContext from within the
 * repository lock.
 * @param loader       The ClassLoader.
 * @param logicalName  The ClassLoader MBean ObjectName.
 */
private void addClassLoader(ClassLoader loader,
        final ObjectName logicalName) {
    /**
     * Called when the newly registered MBean is a ClassLoader
     * If so, tell the ClassLoaderRepository (CLR) about it.  We do
     * this even if the loader is a PrivateClassLoader.  In that
     * case, the CLR remembers the loader for use when it is
     * explicitly named (e.g. as the loader in createMBean) but
     * does not add it to the list that is consulted by
     * ClassLoaderRepository.loadClass.
     */
    final ModifiableClassLoaderRepository clr = getInstantiatorCLR();
    if (clr == null) {
        final RuntimeException wrapped =
                new IllegalArgumentException(
                "Dynamic addition of class loaders" +
                " is not supported");
        throw new RuntimeOperationsException(wrapped,
                "Exception occurred trying to register" +
                " the MBean as a class loader");
    }
    clr.addClassLoader(logicalName, loader);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号