⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pluginclassloader.java

📁 myjxta是用jxta开发的一个p2p通讯软件 有聊天 文件共享 视频3大功能 界面采用swing
💻 JAVA
字号:
package net.jxta.myjxta.plugin;import java.net.URL;import java.net.URLClassLoader;public final class PluginClassLoader extends URLClassLoader{    private final boolean m_isCaching=true;    /**     * Constructs a new URLClassLoader for the specified URLs using the     * default delegation parent <code>ClassLoader</code>. The URLs will     * be searched in the order specified for classes and resources after     * first searching in the parent class loader. Any URL that ends with     * a '/' is assumed to refer to a directory. Otherwise, the URL is     * assumed to refer to a JAR file which will be downloaded and opened     * as needed.     * <p/>     * <p>If there is a security manager, this method first     * calls the security manager's <code>checkCreateClassLoader</code> method     * to ensure creation of a class loader is allowed.     *     * @param urls the URLs from which to load classes and resources     * @throws SecurityException if a security manager exists and its     *                           <code>checkCreateClassLoader</code> method doesn't allow     *                           creation of a class loader.     * @see SecurityManager#checkCreateClassLoader     */    public PluginClassLoader(URL[] urls,ClassLoader parent) {        super(urls,parent);                    }    @SuppressWarnings("unchecked")	protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException {            if (m_isCaching){                return super.loadClass(name,resolve);            } else {                Class c = findClass(name);                if (resolve) {                    resolveClass(c);                }                return c;            }    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -