Package org.apache.catalina
Interface Loader
- 
- All Known Implementing Classes:
- WebappLoader
 
 public interface LoaderA Loader represents a Java ClassLoader implementation that can be used by a Container to load class files (within a repository associated with the Loader) that are designed to be reloaded upon request, as well as a mechanism to detect whether changes have occurred in the underlying repository.In order for a Loaderimplementation to successfully operate with aContextimplementation that implements reloading, it must obey the following constraints:- Must implement Lifecycleso that the Context can indicate that a new class loader is required.
- The start()method must unconditionally create a newClassLoaderimplementation.
- The stop()method must throw away its reference to theClassLoaderpreviously utilized, so that the class loader, all classes loaded by it, and all objects of those classes, can be garbage collected.
- Must allow a call to stop()to be followed by a call tostart()on the sameLoaderinstance.
- Based on a policy chosen by the implementation, must call the
     Context.reload()method on the owningContextwhen a change to one or more of the class files loaded by this class loader is detected.
 - Author:
- Craig R. McClanahan
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)Add a property change listener to this component.voidbackgroundProcess()Execute a periodic task, such as reloading, etc.java.lang.ClassLoadergetClassLoader()ContextgetContext()booleangetDelegate()booleangetReloadable()Deprecated.booleanmodified()Has the internal repository associated with this Loader been modified, such that the loaded classes should be reloaded?voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)Remove a property change listener from this component.voidsetContext(Context context)Set the Context with which this Loader has been associated.voidsetDelegate(boolean delegate)Set the "follow standard delegation model" flag used to configure our ClassLoader.voidsetReloadable(boolean reloadable)Deprecated.
 
- 
- 
- 
Method Detail- 
backgroundProcessvoid backgroundProcess() Execute a periodic task, such as reloading, etc. This method will be invoked inside the classloading context of this container. Unexpected throwables will be caught and logged.
 - 
getClassLoaderjava.lang.ClassLoader getClassLoader() - Returns:
- the Java class loader to be used by this Container.
 
 - 
getContextContext getContext() - Returns:
- the Context with which this Loader has been associated.
 
 - 
setContextvoid setContext(Context context) Set the Context with which this Loader has been associated.- Parameters:
- context- The associated Context
 
 - 
getDelegateboolean getDelegate() - Returns:
- the "follow standard delegation model" flag used to configure our ClassLoader.
 
 - 
setDelegatevoid setDelegate(boolean delegate) Set the "follow standard delegation model" flag used to configure our ClassLoader.- Parameters:
- delegate- The new flag
 
 - 
getReloadable@Deprecated boolean getReloadable() Deprecated.UseContext.getReloadable(). This method will be removed in Tomcat 10.- Returns:
- the reloadable flag for this Loader.
 
 - 
setReloadable@Deprecated void setReloadable(boolean reloadable) Deprecated.UseContext.setReloadable(boolean). This method will be removed in Tomcat 10.Set the reloadable flag for this Loader.- Parameters:
- reloadable- The new reloadable flag
 
 - 
addPropertyChangeListenervoid addPropertyChangeListener(java.beans.PropertyChangeListener listener) Add a property change listener to this component.- Parameters:
- listener- The listener to add
 
 - 
modifiedboolean modified() Has the internal repository associated with this Loader been modified, such that the loaded classes should be reloaded?- Returns:
- truewhen the repository has been modified,- falseotherwise
 
 - 
removePropertyChangeListenervoid removePropertyChangeListener(java.beans.PropertyChangeListener listener) Remove a property change listener from this component.- Parameters:
- listener- The listener to remove
 
 
- 
 
-