public class ParentLastClassLoader extends URLClassLoader
This class loader delegates to the parent class loader ONLY if it cannot find it itself. This is meant to solve classloading issues when running something as, say, a plugin inside an application that may have already loaded a different version of some required jars. This makes sure it looks locally first. This is the opposite of a ClassLoader's typical behavior, but it necessary when you can't control the environment in which you're running.
Using this class can be very dangerous. You must carefully make sure you understand the ramifications of using this. You should also probably make this the first class loader between your plugin and the plugin's owner.
| Constructor and Description |
|---|
ParentLastClassLoader(URL[] urls) |
ParentLastClassLoader(URL[] urls,
ClassLoader parent) |
ParentLastClassLoader(URL[] urls,
ClassLoader parent,
URLStreamHandlerFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
Class<?> |
loadClass(String name) |
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstancedefineClass, defineClassclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignerspublic ParentLastClassLoader(URL[] urls, ClassLoader parent)
public ParentLastClassLoader(URL[] urls)
public ParentLastClassLoader(URL[] urls, ClassLoader parent, URLStreamHandlerFactory factory)
public Class<?> loadClass(String name) throws ClassNotFoundException
loadClass in class ClassLoaderClassNotFoundExceptionCopyright © 2013. All rights reserved