|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.ClassLoader
main.AdaptiveClassLoader
Constructor Summary | |
AdaptiveClassLoader(java.util.Vector classRepository)
Creates a new class loader that will load classes from specified class repositories. |
Method Summary | |
java.net.URL |
getResource(java.lang.String name)
Find a resource with a given name. |
java.io.InputStream |
getResourceAsStream(java.lang.String name)
Get an InputStream on a given resource. |
protected java.lang.Class |
loadClass(java.io.File file,
boolean resolve)
Resolves the specified name to a Class. |
AdaptiveClassLoader |
reinstantiate()
Re-instantiate this class loader. |
boolean |
shouldReload()
Check whether the classloader should be reinstantiated. |
boolean |
shouldReload(java.lang.String classname)
Check to see if a given class should be reloaded because of a modification to the original class. |
Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, 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 AdaptiveClassLoader(java.util.Vector classRepository) throws java.lang.IllegalArgumentException
classRepository
- An set of File classes indicating
directories and/or zip/jar files. It may be empty when
only system classes are loaded.Method Detail |
public boolean shouldReload(java.lang.String classname)
public boolean shouldReload()
The classloader must be replaced if there is any class whose origin file has changed since it was last loaded.
public AdaptiveClassLoader reinstantiate()
This method creates a new instance of the class loader that will load classes form the same path as this one.
protected java.lang.Class loadClass(java.io.File file, boolean resolve) throws java.lang.ClassNotFoundException
file
- the class fileresolve
- true if the Class needs to be resolved;
false if the virtual machine just wants to determine
whether the class exists or not
java.lang.ClassNotFoundException
- if the class loader cannot
find a the requested class.public java.io.InputStream getResourceAsStream(java.lang.String name)
The JServClassLoader translate the resource's name to a file or a zip entry. It looks for the resource in all its repository entry.
name
- the name of the resource, to be used as is.
Class.getResourceAsStream(String)
public java.net.URL getResource(java.lang.String name)
This classloader looks for the resource only in the directory repository for this resource.
name
- the name of the resource, to be used as is.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |