gate.util
Class ReloadingClassLoader.LocationClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by 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.
 
Constructor Summary
ReloadingClassLoader.LocationClassLoader(URL location)
          Constructs a LocationClassLoader for a specified URL.
 
Method Summary
protected  Class loadClass(String name, boolean resolve)
          Loads the class with the specified name.
 
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, findClass, findResource, findResources, getPermissions, getURLs, newInstance, newInstance
 
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
 
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
 

Field Detail

classCache

protected Map classCache
A cache for classes already found and loaded.


location

protected URL location
The location to be searched for new classes.

Constructor Detail

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.
Method Detail

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 class
resolve - If true then resolve the class
Returns:
The resulting Class object
Throws:
ClassNotFoundException - If the class could not be found