|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.ClassLoader java.security.SecureClassLoader java.net.URLClassLoader abbot.util.PathClassLoader abbot.util.NonDelegatingClassLoader abbot.script.AppClassLoader
public class AppClassLoader
A custom class loader which installs itself as if it were the application class loader. A classpath of null is equivalent to the system property java.class.path.
The class loader may optionally load a class before the parent class loader gets a chance to look for the class (instead of the default behavior, which always delegates to the parent class loader first). This behavior enables the class to be reloaded simply by using a new instance of this class loader with each launch of the app.
This class mimics the behavior of sun.misc.Launcher$AppClassLoader as much as possible.
Bootstrap classes are always delegated to the bootstrap loader, with the exception of the sun.applet package, which should never be delegated, since it does not work properly unless it is reloaded.
The parent of this class loader will be the normal, default AppClassLoader (specifically, the class loader which loaded this class will be used).
Constructor Summary | |
---|---|
AppClassLoader()
Constructs an AppClassLoader using the current classpath (as found in java.class.path). |
|
AppClassLoader(String classPath)
Constructs a AppClassLoader with a custom classpath, indicating whether the class loader should delegate to its parent class loader prior to searching for a given resource. |
Method Summary | |
---|---|
Class |
findClass(String name)
Finds and loads the class with the specified name from the search path. |
void |
install()
Ensure that everything else subsequently loaded on the same thread or any subsequently spawned threads uses the given class loader. |
boolean |
isEventDispatchThread()
|
boolean |
isInstalled()
|
protected boolean |
shouldDelegate(String name)
Should the parent class loader try to load this class first? |
String |
toString()
|
void |
uninstall()
Reverse the effects of install. |
Methods inherited from class abbot.util.NonDelegatingClassLoader |
---|
loadClass |
Methods inherited from class abbot.util.PathClassLoader |
---|
convertPathToFilenames, convertPathToFiles, getClassPath |
Methods inherited from class java.net.URLClassLoader |
---|
addURL, definePackage, findResource, findResources, getPermissions, getURLs, newInstance, newInstance |
Methods inherited from class java.security.SecureClassLoader |
---|
defineClass, defineClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AppClassLoader()
public AppClassLoader(String classPath)
The class path argument may use either a colon or semicolon to separate its elements.
Method Detail |
---|
public boolean isEventDispatchThread()
protected boolean shouldDelegate(String name)
shouldDelegate
in class NonDelegatingClassLoader
public Class findClass(String name) throws ClassNotFoundException
findClass
in class NonDelegatingClassLoader
name
- the name of the class
ClassNotFoundException
- if the class could not be foundpublic void install()
public boolean isInstalled()
public void uninstall()
public String toString()
toString
in class PathClassLoader
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |