org.apache.catalina.loader
public class WebappLoader extends java.lang.Object implements Lifecycle, Loader, java.beans.PropertyChangeListener, javax.management.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.
| Modifier and Type | Field and Description |
|---|---|
protected LifecycleSupport |
lifecycle
The lifecycle event support for this component.
|
protected static StringManager |
sm
The string manager for this package.
|
protected java.beans.PropertyChangeSupport |
support
The property change support for this component.
|
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, DESTROY_EVENT, INIT_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT| Constructor and Description |
|---|
WebappLoader()
Construct a new WebappLoader with no defined parent class loader
(so that the actual parent will be the system class loader).
|
WebappLoader(java.lang.ClassLoader parent)
Construct a new WebappLoader with the specified class loader
to be defined as the parent of the ClassLoader we ultimately create.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener to this component.
|
void |
addRepository(java.lang.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.
|
java.lang.String[] |
findRepositories()
Return the set of repositories defined for this class loader.
|
java.lang.ClassLoader |
getClassLoader()
Return the Java class loader to be used by this Container.
|
java.lang.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.
|
javax.management.ObjectName |
getController() |
boolean |
getDelegate()
Return the "follow standard delegation model" flag used to configure
our ClassLoader.
|
java.lang.String |
getInfo()
Return descriptive information about this Loader implementation and
the corresponding version number, in the format
<description>/<version>. |
java.lang.String |
getLoaderClass()
Return the ClassLoader class name.
|
java.lang.String[] |
getLoaderRepositories() |
java.lang.String |
getLoaderRepositoriesString() |
boolean |
getReloadable()
Return the reloadable flag for this Loader.
|
java.lang.String[] |
getRepositories() |
java.lang.String |
getRepositoriesString()
Extra repositories for this loader
|
boolean |
getSearchExternalFirst() |
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(java.lang.Boolean registrationDone) |
void |
preDeregister() |
javax.management.ObjectName |
preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name) |
void |
propertyChange(java.beans.PropertyChangeEvent event)
Process property change events from our associated Context.
|
void |
removeLifecycleListener(LifecycleListener listener)
Remove a lifecycle event listener from this component.
|
void |
removePropertyChangeListener(java.beans.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(javax.management.ObjectName controller) |
void |
setDelegate(boolean delegate)
Set the "follow standard delegation model" flag used to configure
our ClassLoader.
|
void |
setLoaderClass(java.lang.String loaderClass)
Set the ClassLoader class name.
|
void |
setReloadable(boolean reloadable)
Set the reloadable flag for this Loader.
|
void |
setSearchExternalFirst(boolean searchExternalFirst) |
void |
start()
Start this component, initializing our associated class loader.
|
void |
stop()
Stop this component, finalizing our associated class loader.
|
java.lang.String |
toString()
Return a String representation of this component.
|
protected LifecycleSupport lifecycle
protected static final StringManager sm
protected java.beans.PropertyChangeSupport support
public WebappLoader()
public WebappLoader(java.lang.ClassLoader parent)
parent - The parent class loaderpublic java.lang.ClassLoader getClassLoader()
getClassLoader in interface Loaderpublic Container getContainer()
getContainer in interface Loaderpublic void setContainer(Container container)
setContainer in interface Loadercontainer - The associated Containerpublic boolean getDelegate()
getDelegate in interface Loaderpublic void setDelegate(boolean delegate)
setDelegate in interface Loaderdelegate - The new flagpublic java.lang.String getInfo()
<description>/<version>.public java.lang.String getLoaderClass()
public void setLoaderClass(java.lang.String loaderClass)
loaderClass - The new ClassLoader class namepublic boolean getReloadable()
getReloadable in interface Loaderpublic void setReloadable(boolean reloadable)
setReloadable in interface Loaderreloadable - The new reloadable flagpublic boolean getSearchExternalFirst()
public void setSearchExternalFirst(boolean searchExternalFirst)
searchExternalFirst - Whether external repositories should be searched firstpublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener in interface Loaderlistener - The listener to addpublic void addRepository(java.lang.String repository)
addRepository in interface Loaderrepository - Repository to be addedpublic void backgroundProcess()
backgroundProcess in interface Loaderpublic java.lang.String[] findRepositories()
findRepositories in interface Loaderpublic java.lang.String[] getRepositories()
public java.lang.String getRepositoriesString()
public java.lang.String[] getLoaderRepositories()
public java.lang.String getLoaderRepositoriesString()
public java.lang.String getClasspath()
public boolean modified()
public void closeJARs(boolean force)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener in interface Loaderlistener - The listener to removepublic java.lang.String toString()
toString in class java.lang.Objectpublic void addLifecycleListener(LifecycleListener listener)
addLifecycleListener in interface Lifecyclelistener - The listener to addpublic LifecycleListener[] findLifecycleListeners()
findLifecycleListeners in interface Lifecyclepublic void removeLifecycleListener(LifecycleListener listener)
removeLifecycleListener in interface Lifecyclelistener - The listener to removepublic void init()
public void destroy()
public void start()
throws LifecycleException
start in interface LifecycleLifecycleException - if a lifecycle error occurspublic void stop()
throws LifecycleException
stop in interface LifecycleLifecycleException - if a lifecycle error occurspublic void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange in interface java.beans.PropertyChangeListenerevent - The property change event that has occurredpublic javax.management.ObjectName preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
throws java.lang.Exception
preRegister in interface javax.management.MBeanRegistrationjava.lang.Exceptionpublic void postRegister(java.lang.Boolean registrationDone)
postRegister in interface javax.management.MBeanRegistrationpublic void preDeregister()
throws java.lang.Exception
preDeregister in interface javax.management.MBeanRegistrationjava.lang.Exceptionpublic void postDeregister()
postDeregister in interface javax.management.MBeanRegistrationpublic javax.management.ObjectName getController()
public void setController(javax.management.ObjectName controller)
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.