org.apache.catalina.loader
public class WebappLoader extends Object implements Lifecycle, Loader, PropertyChangeListener, MBeanRegistration
This class loader is configured by adding the pathnames of directories,
JAR files, and ZIP files with the addRepository()
method,
prior to calling start()
. When a new class is required,
these repositories will be consulted first to locate the class. If it
is not present, the system class loader will be used instead.
Version: $Revision: 893564 $ $Date: 2009-12-23 17:31:31 +0100 (Wed, 23 Dec 2009) $
Field Summary | |
---|---|
protected LifecycleSupport | lifecycle
The lifecycle event support for this component. |
protected static StringManager | sm
The string manager for this package. |
protected PropertyChangeSupport | support
The property change support for this component. |
Constructor Summary | |
---|---|
WebappLoader()
Construct a new WebappLoader with no defined parent class loader
(so that the actual parent will be the system class loader). | |
WebappLoader(ClassLoader parent)
Construct a new WebappLoader with the specified class loader
to be defined as the parent of the ClassLoader we ultimately create.
|
Method Summary | |
---|---|
void | addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component.
|
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.
|
void | backgroundProcess()
Execute a periodic task, such as reloading, etc. |
void | closeJARs(boolean force)
Used to periodically signal to the classloader to release JAR resources. |
void | destroy() |
LifecycleListener[] | findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle. |
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. |
String | getClasspath()
Classpath, as set in org.apache.catalina.jsp_classpath context
property
|
Container | getContainer()
Return the Container with which this Logger has been associated. |
ObjectName | getController() |
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> . |
String | getLoaderClass()
Return the ClassLoader class name. |
String[] | getLoaderRepositories() |
String | getLoaderRepositoriesString() |
boolean | getReloadable()
Return the reloadable flag for this Loader. |
String[] | getRepositories() |
String | getRepositoriesString() Extra repositories for this loader |
void | init() |
boolean | modified()
Has the internal repository associated with this Loader been modified,
such that the loaded classes should be reloaded? |
void | postDeregister() |
void | postRegister(Boolean registrationDone) |
void | preDeregister() |
ObjectName | preRegister(MBeanServer server, ObjectName name) |
void | propertyChange(PropertyChangeEvent event)
Process property change events from our associated Context.
|
void | removeLifecycleListener(LifecycleListener listener)
Remove a lifecycle event listener from this component.
|
void | removePropertyChangeListener(PropertyChangeListener listener)
Remove a property change listener from this component.
|
void | setContainer(Container container)
Set the Container with which this Logger has been associated.
|
void | setController(ObjectName controller) |
void | setDelegate(boolean delegate)
Set the "follow standard delegation model" flag used to configure
our ClassLoader.
|
void | setLoaderClass(String loaderClass)
Set the ClassLoader class name.
|
void | setReloadable(boolean reloadable)
Set the reloadable flag for this Loader.
|
void | start()
Start this component, initializing our associated class loader.
|
void | stop()
Stop this component, finalizing our associated class loader.
|
String | toString()
Return a String representation of this component. |
Parameters: parent The parent class loader
Parameters: listener The listener to add
Parameters: listener The listener to add
Parameters: repository Repository to be added
Returns: The classpath
<description>/<version>
.Parameters: event The property change event that has occurred
Parameters: listener The listener to remove
Parameters: listener The listener to remove
Parameters: container The associated Container
Parameters: delegate The new flag
Parameters: loaderClass The new ClassLoader class name
Parameters: reloadable The new reloadable flag
Throws: LifecycleException if a lifecycle error occurs
Throws: LifecycleException if a lifecycle error occurs