|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.ClassLoader | +--com.caucho.util.DynamicClassLoader
Class loader which checks for changes in class files and automatically picks up new jars.
DynamicClassLoaders can be chained creating one virtual class loader. From the perspective of the JDK, it's all one classloader. Internally, the class loader chain searches like a classpath.
Inner Class Summary | |
class |
DynamicClassLoader.Entry
Describes a cached loaded class entry. |
Field Summary | |
protected DynamicClassLoader |
top
|
Constructor Summary | |
protected |
DynamicClassLoader()
Create a new class loader |
protected |
DynamicClassLoader(java.lang.ClassLoader parent)
Create a new class loader (jdk1.2) |
Method Summary | |
void |
addListener(ClassLoaderListener listener)
Adds a listener to detect class loader changes. |
protected java.lang.Class |
findClass(java.lang.String name)
Load a class using this class loader |
java.lang.String |
findLibrary(java.lang.String name)
Returns the full library path for the name. |
java.lang.Object |
getAttribute(java.lang.String name)
Returns the named attributes |
protected DynamicClassLoader.Entry |
getClassEntry(java.lang.String name)
Returns the class entry. |
java.lang.String |
getClassPath()
Fill data for the class path. |
protected java.lang.String |
getClassPath(java.lang.String head)
Default implementation of getting a classpath segment. |
java.lang.ClassLoader |
getParentLoader()
Returns the parent class loader. |
protected Path |
getPath(java.lang.String name)
Returns the path of the named resource |
java.net.URL |
getResource(java.lang.String name)
Gets the named resource |
java.io.InputStream |
getResourceAsStream(java.lang.String name)
Opens a stream to a resource somewhere in the classpath |
java.lang.String |
getSourcePath()
Returns the source path. |
protected java.lang.String |
getSourcePath(java.lang.String head)
Default implementation of getting a sourcepath segment. |
DynamicClassLoader |
getTop()
Returns the first classloader in the virtual chain. |
boolean |
isModified()
Returns true if any of the classes have been modified. |
protected boolean |
isModifiedInt()
True if any of the loaded classes have been modified. |
java.lang.Class |
loadClass(java.lang.String name,
boolean resolve)
Load a class using this class loader |
void |
makeAll()
Makes any changed classes for the virtual class loader. |
protected void |
makeAllInt()
Makes any changed classes for this specific class loader. |
void |
setAttribute(java.lang.String name,
java.lang.Object obj)
Sets the named attributes |
void |
setNext(DynamicClassLoader next)
Sets the next class loader in the virtual chain. |
void |
setParent(java.lang.ClassLoader parent)
Sets the parent of the class loader. |
void |
unload()
Unloads the classloader. |
Methods inherited from class java.lang.ClassLoader |
defineClass, defineClass, defineClass, definePackage, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setSigners |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected DynamicClassLoader top
Constructor Detail |
protected DynamicClassLoader()
protected DynamicClassLoader(java.lang.ClassLoader parent)
parent
- parent class loaderMethod Detail |
public void setParent(java.lang.ClassLoader parent)
parent
- the parent classloaderpublic void setNext(DynamicClassLoader next)
public DynamicClassLoader getTop()
public java.lang.ClassLoader getParentLoader()
public final java.lang.String getClassPath()
public final java.lang.String getSourcePath()
protected java.lang.String getClassPath(java.lang.String head)
protected java.lang.String getSourcePath(java.lang.String head)
public final boolean isModified()
protected boolean isModifiedInt()
public final void makeAll() throws java.lang.Exception
protected void makeAllInt() throws java.lang.Exception
public final void addListener(ClassLoaderListener listener)
public void unload()
public final java.lang.Class loadClass(java.lang.String name, boolean resolve) throws java.lang.ClassNotFoundException
loadClass
in class java.lang.ClassLoader
protected final java.lang.Class findClass(java.lang.String name) throws java.lang.ClassNotFoundException
findClass
in class java.lang.ClassLoader
protected DynamicClassLoader.Entry getClassEntry(java.lang.String name) throws java.lang.ClassNotFoundException
name
- name of the classpublic final java.net.URL getResource(java.lang.String name)
getResource
in class java.lang.ClassLoader
name
- name of the resourcepublic final java.io.InputStream getResourceAsStream(java.lang.String name)
getResourceAsStream
in class java.lang.ClassLoader
public java.lang.String findLibrary(java.lang.String name)
findLibrary
in class java.lang.ClassLoader
protected Path getPath(java.lang.String name)
name
- the name of the resource.public java.lang.Object getAttribute(java.lang.String name)
public void setAttribute(java.lang.String name, java.lang.Object obj)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |