gate.util
Class ReloadingClassLoader.LocationClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
gate.util.ReloadingClassLoader.LocationClassLoader
- Enclosing class:
- ReloadingClassLoader
protected class ReloadingClassLoader.LocationClassLoader
- extends URLClassLoader
A ClassLoader that loads classes from a location specified by an URL.
Field Summary |
protected Map |
classCache
A cache for classes already found and loaded. |
protected URL |
location
The location to be searched for new classes. |
Method Summary |
protected Class |
loadClass(String name,
boolean resolve)
Loads the class with the specified name. |
Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
classCache
protected Map classCache
- A cache for classes already found and loaded.
location
protected URL location
- The location to be searched for new classes.
ReloadingClassLoader.LocationClassLoader
public ReloadingClassLoader.LocationClassLoader(URL location)
- Constructs a LocationClassLoader for a specified URL.
Uses the same parent classloader as the enclosing ReloadingClassLoader.
- Parameters:
location
- the URL to be searched for class files.
loadClass
protected Class loadClass(String name,
boolean resolve)
throws ClassNotFoundException
- Loads the class with the specified name. It will search first the parent
class loader, then an internal cache for classes already loaded and then
the registered URL.
- Overrides:
loadClass
in class ClassLoader
- Parameters:
name
- The name of the classresolve
- If true then resolve the class
- Returns:
- The resulting Class object
- Throws:
ClassNotFoundException
- If the class could not be found