Java 类org.springframework.boot.loader.jar.Handler 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:LaunchedURLClassLoader.java   
@Override
protected Class<?> loadClass(String name, boolean resolve)
        throws ClassNotFoundException {
    Handler.setUseFastConnectionExceptions(true);
    try {
        try {
            definePackageIfNecessary(name);
        }
        catch (IllegalArgumentException ex) {
            // Tolerate race condition due to being parallel capable
            if (getPackage(name) == null) {
                // This should never happen as the IllegalArgumentException indicates
                // that the package has already been defined and, therefore,
                // getPackage(name) should not return null.
                throw new AssertionError("Package " + name + " has already been "
                        + "defined but it could not be found");
            }
        }
        return super.loadClass(name, resolve);
    }
    finally {
        Handler.setUseFastConnectionExceptions(false);
    }
}
项目:spring-boot-concourse    文件:LaunchedURLClassLoader.java   
@Override
protected Class<?> loadClass(String name, boolean resolve)
        throws ClassNotFoundException {
    Handler.setUseFastConnectionExceptions(true);
    try {
        try {
            definePackageIfNecessary(name);
        }
        catch (IllegalArgumentException ex) {
            // Tolerate race condition due to being parallel capable
            if (getPackage(name) == null) {
                // This should never happen as the IllegalArgumentException indicates
                // that the package has already been defined and, therefore,
                // getPackage(name) should not return null.
                throw new AssertionError("Package " + name + " has already been "
                        + "defined but it could not be found");
            }
        }
        return super.loadClass(name, resolve);
    }
    finally {
        Handler.setUseFastConnectionExceptions(false);
    }
}
项目:contestparser    文件:LaunchedURLClassLoader.java   
/**
 * Attempt to load classes from the URLs before delegating to the parent loader.
 */
@Override
protected Class<?> loadClass(String name, boolean resolve)
        throws ClassNotFoundException {
    synchronized (LaunchedURLClassLoader.LOCK_PROVIDER.getLock(this, name)) {
        Class<?> loadedClass = findLoadedClass(name);
        if (loadedClass == null) {
            Handler.setUseFastConnectionExceptions(true);
            try {
                loadedClass = doLoadClass(name);
            }
            finally {
                Handler.setUseFastConnectionExceptions(false);
            }
        }
        if (resolve) {
            resolveClass(loadedClass);
        }
        return loadedClass;
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:LaunchedURLClassLoader.java   
@Override
public URL findResource(String name) {
    Handler.setUseFastConnectionExceptions(true);
    try {
        return super.findResource(name);
    }
    finally {
        Handler.setUseFastConnectionExceptions(false);
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:LaunchedURLClassLoader.java   
@Override
public Enumeration<URL> findResources(String name) throws IOException {
    Handler.setUseFastConnectionExceptions(true);
    try {
        return super.findResources(name);
    }
    finally {
        Handler.setUseFastConnectionExceptions(false);
    }
}
项目:spring-boot-concourse    文件:LaunchedURLClassLoader.java   
@Override
public URL findResource(String name) {
    Handler.setUseFastConnectionExceptions(true);
    try {
        return super.findResource(name);
    }
    finally {
        Handler.setUseFastConnectionExceptions(false);
    }
}
项目:spring-boot-concourse    文件:LaunchedURLClassLoader.java   
@Override
public Enumeration<URL> findResources(String name) throws IOException {
    Handler.setUseFastConnectionExceptions(true);
    try {
        return super.findResources(name);
    }
    finally {
        Handler.setUseFastConnectionExceptions(false);
    }
}
项目:contestparser    文件:LaunchedURLClassLoader.java   
@Override
public boolean hasMoreElements() {
    try {
        Handler.setUseFastConnectionExceptions(true);
        return this.rootResources.hasMoreElements()
                || this.localResources.hasMoreElements();
    }
    finally {
        Handler.setUseFastConnectionExceptions(false);
    }
}