|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.ClassLoader org.sadun.util.DynamicClassLoader
A classloader whose classpath can be set dynamically.
Version 1.2 adds resource support capability, but for the
findResources()
which
is not implemented.
By default, the classLoader attempts to use the parent class loader,
if any, to find a class. By setting the forceDynamicLoading
property, the classLoader will always find
classes by using the embedded DynamicClassFileFinder
.
$Revision$
Constructor Summary | |
DynamicClassLoader()
Constructor for DynamicClassLoader. |
|
DynamicClassLoader(java.lang.ClassLoader arg0)
|
|
DynamicClassLoader(java.lang.ClassLoader arg0,
DynamicClassFileFinder cff,
DynamicResourceFileFinder rff)
Constructor for DynamicClassLoader. |
|
DynamicClassLoader(DynamicClassFileFinder cff,
DynamicResourceFileFinder rff)
Constructor for DynamicClassLoader. |
Method Summary | |
void |
addClassPathEntry(java.lang.String entry)
Add a class path entry |
protected java.lang.Class |
findClass(java.lang.String arg0)
|
protected java.lang.String |
findLibrary(java.lang.String libname)
Looks for a library in classpath and load it if found. |
protected java.net.URL |
findResource(java.lang.String name)
|
protected java.util.Enumeration |
findResources(java.lang.String name)
|
DynamicClassFileFinder |
getClassFileFinder()
|
java.lang.String |
getClassPath()
Returnt the current class path |
java.io.InputStream |
getResourceAsStream(java.lang.String name)
|
DynamicResourceFileFinder |
getResourceFileFinder()
|
boolean |
isForceDynamicLoading()
Returns the forceDynamicLoading. |
protected java.lang.Class |
loadClass(java.lang.String name,
boolean resolve)
|
static void |
main(java.lang.String[] args)
|
void |
setClassPath(java.lang.String classPath)
Set the class path |
void |
setForceDynamicLoading(boolean forceDynamicLoading)
Sets the forceDynamicLoading. |
Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, defineClass, defineClass, defineClass, definePackage, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, 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 |
Constructor Detail |
public DynamicClassLoader(java.lang.ClassLoader arg0, DynamicClassFileFinder cff, DynamicResourceFileFinder rff)
arg0
- public DynamicClassLoader(DynamicClassFileFinder cff, DynamicResourceFileFinder rff)
public DynamicClassLoader(java.lang.ClassLoader arg0)
public DynamicClassLoader()
Method Detail |
public DynamicClassFileFinder getClassFileFinder()
public DynamicResourceFileFinder getResourceFileFinder()
public void addClassPathEntry(java.lang.String entry)
public void setClassPath(java.lang.String classPath)
public java.lang.String getClassPath()
public static void main(java.lang.String[] args)
protected java.lang.Class findClass(java.lang.String arg0) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
ClassLoader.findClass(java.lang.String)
protected java.net.URL findResource(java.lang.String name)
ClassLoader.findResource(java.lang.String)
protected java.util.Enumeration findResources(java.lang.String name) throws java.io.IOException
java.io.IOException
ClassLoader.findResources(java.lang.String)
public java.io.InputStream getResourceAsStream(java.lang.String name)
ClassLoader.getResourceAsStream(java.lang.String)
public boolean isForceDynamicLoading()
public void setForceDynamicLoading(boolean forceDynamicLoading)
forceDynamicLoading
- The forceDynamicLoading to setprotected java.lang.Class loadClass(java.lang.String name, boolean resolve) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
ClassLoader.loadClass(java.lang.String, boolean)
protected java.lang.String findLibrary(java.lang.String libname)
ClassLoader.findLibrary(java.lang.String)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |