public class ReloadingClassLoader extends ClassLoader
The ReloadingClassLoader uses a delegation mechanism to allow classes to be reloaded. That means that loadClass calls may return different results if the class was changed in the underlying ResourceStore.
class taken from Apache JCI
Constructor and Description |
---|
ReloadingClassLoader(ClassLoader pParent) |
Modifier and Type | Method and Description |
---|---|
boolean |
addResourceStore(ResourceStore pStore) |
void |
clearAssertionStatus() |
URL |
getResource(String name) |
InputStream |
getResourceAsStream(String name) |
protected boolean |
isAccepted(String className) |
Class |
loadClass(String name) |
void |
reload() |
boolean |
removeResourceStore(ResourceStore pStore) |
void |
setAccepClasses(Set<Pattern> acceptClasses) |
void |
setClassAssertionStatus(String className,
boolean enabled) |
void |
setDefaultAssertionStatus(boolean enabled) |
void |
setPackageAssertionStatus(String packageName,
boolean enabled) |
defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setSigners
public ReloadingClassLoader(ClassLoader pParent)
public boolean addResourceStore(ResourceStore pStore)
public boolean removeResourceStore(ResourceStore pStore)
public void reload()
public void clearAssertionStatus()
clearAssertionStatus
in class ClassLoader
public URL getResource(String name)
getResource
in class ClassLoader
public InputStream getResourceAsStream(String name)
getResourceAsStream
in class ClassLoader
public Class loadClass(String name) throws ClassNotFoundException
loadClass
in class ClassLoader
ClassNotFoundException
public void setClassAssertionStatus(String className, boolean enabled)
setClassAssertionStatus
in class ClassLoader
public void setDefaultAssertionStatus(boolean enabled)
setDefaultAssertionStatus
in class ClassLoader
public void setPackageAssertionStatus(String packageName, boolean enabled)
setPackageAssertionStatus
in class ClassLoader
protected boolean isAccepted(String className)
Copyright © 2000–2024 Apache Software Foundation. All rights reserved.