/* JFox, the OpenSource J2EE Application Server
 *
 * Distributable under GNU LGPL license by gun.org
 * more details please visit http://www.huihoo.org/jfox
 */

package org.jfox.framework.loader;

import java.net.URL;
import java.net.URLClassLoader;
import java.util.jar.Manifest;

/**
 * @author <a href="mailto:young_yy@hotmail.com">Young Yang</a>
 */

public class NestedURLClassLoader extends URLClassLoader {
    /**
     * null parent class loader
     *
     * @param urls
     */
    public NestedURLClassLoader(URL[] urls) {
        super(urls, null);
    }

    public NestedURLClassLoader(URL[] urls, ClassLoader parent) {
        super(urls, parent);
    }

    protected void addURL(URL url) {
        super.addURL(url);
    }

    protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException {
        return super.loadClass(name, resolve);
    }

    protected Class findClass(String name) throws ClassNotFoundException {
        Class c = findLoadedClass(name);
        if(c == null) {
            return super.findClass(name);
        }
        return c;
    }

    protected Package[] getPackages() {
        return super.getPackages();
    }

    protected Package definePackage(String name, Manifest man, URL url) throws IllegalArgumentException {
        return super.definePackage(name, man, url);
    }

    protected Package definePackage(String name, String specTitle, String specVersion, String specVendor, String implTitle, String implVersion, String implVendor, URL sealBase) throws IllegalArgumentException {
        return super.definePackage(name, specTitle, specVersion, specVendor, implTitle, implVersion, implVendor, sealBase);
    }

    protected String findLibrary(String libname) {
        return super.findLibrary(libname);
    }

    protected Package getPackage(String name) {
        return super.getPackage(name);
    }
}