FileDocCategorySizeDatePackage
Loader.javaAPI DocGlassfish v2 API6885Fri May 04 22:31:52 BST 2007org.apache.catalina

Loader

public interface Loader
A 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 Loader implementation to successfully operate with a Context implementation that implements reloading, it must obey the following constraints:

  • Must implement Lifecycle so that the Context can indicate that a new class loader is required.
  • The start() method must unconditionally create a new ClassLoader implementation.
  • The stop() method must throw away its reference to the ClassLoader previously 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 to start() on the same Loader instance.
  • Based on a policy chosen by the implementation, must call the Context.reload() method on the owning Context when a change to one or more of the class files loaded by this class loader is detected.
author
Craig R. McClanahan
version
$Revision: 1.4 $ $Date: 2007/05/05 05:31:51 $

Fields Summary
Constructors Summary
Methods Summary
public voidaddOverridablePackage(java.lang.String packageName)
Adds the given package name to the list of packages that may always be overriden, regardless of whether they belong to a protected namespace

public voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener to this component.

param
listener The listener to add

public voidaddRepository(java.lang.String repository)
Add a new repository to the set of repositories for this class loader.

param
repository Repository to be added

public java.lang.String[]findRepositories()
Return the set of repositories defined for this class loader. If none are defined, a zero-length array is returned.

public java.lang.ClassLoadergetClassLoader()
Return the Java class loader to be used by this Container.

public ContainergetContainer()
Return the Container with which this Loader has been associated.

public DefaultContextgetDefaultContext()
Return the DefaultContext with which this Manager is associated.

public booleangetDelegate()
Return the "follow standard delegation model" flag used to configure our ClassLoader.

public java.lang.StringgetInfo()
Return descriptive information about this Loader implementation and the corresponding version number, in the format <description>/<version>.

public booleangetReloadable()
Return the reloadable flag for this Loader.

public booleanmodified()
Has the internal repository associated with this Loader been modified, such that the loaded classes should be reloaded?

public voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener from this component.

param
listener The listener to remove

public voidsetContainer(Container container)
Set the Container with which this Loader has been associated.

param
container The associated Container

public voidsetDefaultContext(DefaultContext defaultContext)
Set the DefaultContext with which this Manager is associated.

param
defaultContext The newly associated DefaultContext

public voidsetDelegate(boolean delegate)
Set the "follow standard delegation model" flag used to configure our ClassLoader.

param
delegate The new flag

public voidsetIgnoreHiddenJarFiles(boolean ignoreHiddenJarFiles)

public voidsetReloadable(boolean reloadable)
Set the reloadable flag for this Loader.

param
reloadable The new reloadable flag