|
||||||||||
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 com.acciente.commons.loader.ReloadingClassLoader
public class ReloadingClassLoader
This classloader loads classes retrieved via a class definition loader (aka ClassDefLoader). This class loader uses the methods provided by a ClassDef (a ClassDef is returned by the ClassDefLoader) to determine if the class has been modified and transparently reloads the class into the JVM if the ClassDef reports that the class has been modified.
This class loader also reads dependency information from the ClassDef. When the load of a class, say A, is requested it recursively checks for modificiations to dependent classes. If any of the the dependent classes are modified it first reloads the dependent classes and then proceeds to reload the class A.
ClassDefLoader
,
ClassDef
Constructor Summary | |
---|---|
ReloadingClassLoader()
Creates a class loader with no parent class loader, this is expected to cause the system class loader to be used as the parent class loader |
|
ReloadingClassLoader(ClassLoader oParentClassLoader)
Creates a class loader that delegates to the specified parent class loader |
Method Summary | |
---|---|
void |
addClassDefLoader(ClassDefLoader oClassDefLoader)
Adds a class definition loader to the list of class definition loaders to search |
void |
addIgnoredClassName(String sIgnoredClassName)
This method is used to add to the list classnames that should be "ignored" as regards the dependency checking. |
void |
addIgnoredClassNamePrefix(String sIgnoredClassNamePrefix)
This method is used to add to list of classname prefixes that should be "ignored" as regards the dependency checking. |
protected Class |
findClass(String sClassName)
|
List |
getClassDefLoaders()
A list of ClassDefLoaders searched by this class loader. |
Collection |
getIgnoredClassNamePrefixes()
Returns the set of classname prefixes that are being "ignored" as regards the dependency checking |
Collection |
getIgnoredClassNames()
Returns the set of classnames that are being "ignored" as regards the dependency checking |
InputStream |
getResourceAsStream(String sResourceName)
Used to load a resource via this classloader |
Class |
loadClass(String sClassName,
boolean bResolve)
|
Methods inherited from class java.security.SecureClassLoader |
---|
defineClass, defineClass, getPermissions |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReloadingClassLoader()
public ReloadingClassLoader(ClassLoader oParentClassLoader)
oParentClassLoader
- the parent class loaderMethod Detail |
---|
public void addClassDefLoader(ClassDefLoader oClassDefLoader)
oClassDefLoader
- an object that implements the class ClassDefLoader interfacepublic List getClassDefLoaders()
public void addIgnoredClassName(String sIgnoredClassName)
sIgnoredClassName
- a string representing a fully qualified classnamepublic void addIgnoredClassNamePrefix(String sIgnoredClassNamePrefix)
sIgnoredClassNamePrefix
- a string representing the prefix of one or more fully qualified classnamespublic Collection getIgnoredClassNames()
public Collection getIgnoredClassNamePrefixes()
public InputStream getResourceAsStream(String sResourceName)
getResourceAsStream
in class ClassLoader
public Class loadClass(String sClassName, boolean bResolve) throws ClassNotFoundException
loadClass
in class ClassLoader
ClassNotFoundException
protected Class findClass(String sClassName) throws ClassNotFoundException
findClass
in class ClassLoader
ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |