org.apache.commons.jci
Class ReloadingClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by org.apache.commons.jci.ReloadingClassLoader
All Implemented Interfaces:
ReloadNotificationListener

public class ReloadingClassLoader
extends ClassLoader
implements ReloadNotificationListener

The ReloadingClassLoader uses a delegation mechansim to allow classes to be reloaded. That means that loadClass calls may return different results if the class was changed in the underlying ResourceStore.

Author:
tcurdt

Constructor Summary
ReloadingClassLoader(ClassLoader pParent)
           
 
Method Summary
 boolean addResourceStore(ResourceStore pStore)
           
 void clearAssertionStatus()
           
 URL getResource(String name)
           
 InputStream getResourceAsStream(String name)
           
 void handleNotification()
           
 Class<?> loadClass(String name)
           
 boolean removeResourceStore(ResourceStore pStore)
           
 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
 

Constructor Detail

ReloadingClassLoader

public ReloadingClassLoader(ClassLoader pParent)
Method Detail

addResourceStore

public boolean addResourceStore(ResourceStore pStore)

removeResourceStore

public boolean removeResourceStore(ResourceStore pStore)

handleNotification

public void handleNotification()
Specified by:
handleNotification in interface ReloadNotificationListener

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


Copyright © 2004–2013 The Apache Software Foundation. All rights reserved.