|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
gate.util.GateClassLoader
GATE's class loader, which allows loading of classes over the net. A list of URLs is searched, which should point at .jar files or to directories containing class file hierarchies. The class loader is unusual in supporting reloading of classes, which is useful for CREOLE developers who want to recompile modules without relaunching GATE. The loader is also used for creating JAPE RHS action classes.
Constructor Summary | |
GateClassLoader()
Default construction - use an empty URL list. |
|
GateClassLoader(ClassLoader parent)
Chaining constructor. |
|
GateClassLoader(URL[] urls)
Default construction with URLs list. |
|
GateClassLoader(URL[] urls,
ClassLoader parent)
Chaining constructor with URLs list. |
Method Summary | |
void |
addURL(URL url)
Appends the specified URL to the list of URLs to search for classes and resources. |
Class |
defineGateClass(String name,
byte[] bytes,
int offset,
int len)
Forward a call to super.defineClass, which is protected and final in super. |
Class |
loadClass(String name,
boolean resolve)
Delegate loading to the super class (loadClass has protected access there). |
Class |
reloadClass(String name)
Reload a class. |
void |
resolveGateClass(Class c)
Forward a call to super.resolveClass, which is protected and final in super. |
Methods inherited from class java.net.URLClassLoader |
findResource, findResources, getURLs, newInstance, newInstance |
Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GateClassLoader()
public GateClassLoader(ClassLoader parent)
public GateClassLoader(URL[] urls)
public GateClassLoader(URL[] urls, ClassLoader parent)
Method Detail |
public void addURL(URL url)
public Class loadClass(String name, boolean resolve) throws ClassNotFoundException
ClassNotFoundException
public Class defineGateClass(String name, byte[] bytes, int offset, int len)
public void resolveGateClass(Class c)
public Class reloadClass(String name) throws ClassNotFoundException
The method works by avoiding the normal chaining behaviour of class loaders by creating a star-shaped group of parallel loaders. Each of these chains of the system class loader, but as long as the class that we wish to reload wan't loaded by the system loader, it will not be present in a new loader of this type.
An implication is that reloaded classes must always be instantiated via the class returned from this method.
ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |