org.apache.catalina
Interface Loader
- WebappLoader
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.
Version:
- Craig R. McClanahan
void | addPropertyChangeListener(PropertyChangeListener listener) - Add a property change listener to this component.
|
void | addRepository(String repository) - Add a new repository to the set of repositories for this class loader.
|
String[] | findRepositories() - Return the set of repositories defined for this class loader.
|
ClassLoader | getClassLoader() - Return the Java class loader to be used by this Container.
|
Container | getContainer() - Return the Container with which this Loader has been associated.
|
DefaultContext | getDefaultContext() - Return the DefaultContext with which this Manager is associated.
|
boolean | getDelegate() - Return the "follow standard delegation model" flag used to configure
our ClassLoader.
|
String | getInfo() - Return descriptive information about this Loader implementation and
the corresponding version number, in the format
<description>/<version> .
|
boolean | getReloadable() - Return the reloadable flag for this Loader.
|
boolean | modified() - Has the internal repository associated with this Loader been modified,
such that the loaded classes should be reloaded?
|
void | removePropertyChangeListener(PropertyChangeListener listener) - Remove a property change listener from this component.
|
void | setContainer(Container container) - Set the Container with which this Loader has been associated.
|
void | setDefaultContext(DefaultContext defaultContext) - Set the DefaultContext with which this Manager is associated.
|
void | setDelegate(boolean delegate) - Set the "follow standard delegation model" flag used to configure
our ClassLoader.
|
void | setReloadable(boolean reloadable) - Set the reloadable flag for this Loader.
|
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
Add a property change listener to this component.
listener
- The listener to add
addRepository
public void addRepository(String repository)
Add a new repository to the set of repositories for this class loader.
repository
- Repository to be added
findRepositories
public String[] findRepositories()
Return the set of repositories defined for this class loader.
If none are defined, a zero-length array is returned.
getClassLoader
public ClassLoader getClassLoader()
Return the Java class loader to be used by this Container.
getContainer
public Container getContainer()
Return the Container with which this Loader has been associated.
getDefaultContext
public DefaultContext getDefaultContext()
Return the DefaultContext with which this Manager is associated.
getDelegate
public boolean getDelegate()
Return the "follow standard delegation model" flag used to configure
our ClassLoader.
getInfo
public String getInfo()
Return descriptive information about this Loader implementation and
the corresponding version number, in the format
<description>/<version>
.
getReloadable
public boolean getReloadable()
Return the reloadable flag for this Loader.
modified
public boolean modified()
Has the internal repository associated with this Loader been modified,
such that the loaded classes should be reloaded?
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
Remove a property change listener from this component.
listener
- The listener to remove
setContainer
public void setContainer(Container container)
Set the Container with which this Loader has been associated.
container
- The associated Container
setDefaultContext
public void setDefaultContext(DefaultContext defaultContext)
Set the DefaultContext with which this Manager is associated.
defaultContext
- The newly associated DefaultContext
setDelegate
public void setDelegate(boolean delegate)
Set the "follow standard delegation model" flag used to configure
our ClassLoader.
delegate
- The new flag
setReloadable
public void setReloadable(boolean reloadable)
Set the reloadable flag for this Loader.
reloadable
- The new reloadable flag
Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.