com.opensymphony.xwork2.util.classloader
Class ReloadingClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by com.opensymphony.xwork2.util.classloader.ReloadingClassLoader

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


Field Summary
private  Set<Pattern> acceptClasses
           
private  ClassLoader delegate
           
private static Logger LOG
           
private  ClassLoader parent
           
private  ResourceStore[] stores
           
 
Constructor Summary
ReloadingClassLoader(ClassLoader pParent)
           
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.ClassLoader
defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, 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

LOG

private static final Logger LOG

parent

private final ClassLoader parent

stores

private ResourceStore[] stores

delegate

private ClassLoader delegate

acceptClasses

private Set<Pattern> acceptClasses
Constructor Detail

ReloadingClassLoader

public ReloadingClassLoader(ClassLoader pParent)
Method Detail

addResourceStore

public boolean addResourceStore(ResourceStore pStore)

removeResourceStore

public boolean removeResourceStore(ResourceStore pStore)

reload

public void reload()

clearAssertionStatus

public void clearAssertionStatus()
Overrides:
clearAssertionStatus in class ClassLoader

getResource

public URL getResource(String name)
Overrides:
getResource in class ClassLoader

getResourceAsStream

public InputStream getResourceAsStream(String name)
Overrides:
getResourceAsStream in class ClassLoader

loadClass

public Class loadClass(String name)
                throws ClassNotFoundException
Overrides:
loadClass in class ClassLoader
Throws:
ClassNotFoundException

setClassAssertionStatus

public void setClassAssertionStatus(String className,
                                    boolean enabled)
Overrides:
setClassAssertionStatus in class ClassLoader

setDefaultAssertionStatus

public void setDefaultAssertionStatus(boolean enabled)
Overrides:
setDefaultAssertionStatus in class ClassLoader

setPackageAssertionStatus

public void setPackageAssertionStatus(String packageName,
                                      boolean enabled)
Overrides:
setPackageAssertionStatus in class ClassLoader

setAccepClasses

public void setAccepClasses(Set<Pattern> acceptClasses)

isAccepted

protected boolean isAccepted(String className)


Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.