|
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.catalina.loader.WebappLoader
Classloader implementation which is specialized for handling web applications in the most efficient way, while being Catalina aware (all accesses to resources are made through the DirContext interface). This class loader supports detection of modified Java classes, which can be used to implement auto-reload support.
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.
Nested Class Summary | |
protected class |
WebappLoader.WebappContextNotifier
Private thread class to notify our associated Context that we have recognized the need for a reload. |
Field Summary | |
protected DefaultContext |
defaultContext
The DefaultContext with which this Loader is associated. |
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. |
Fields inherited from interface org.apache.catalina.Lifecycle |
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, START_EVENT, STOP_EVENT |
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(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. |
Method Summary | |
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. |
LifecycleListener[] |
findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle. |
java.lang.String[] |
findRepositories()
Return the set of repositories defined for this class loader. |
int |
getCheckInterval()
Return the check interval for this Loader. |
java.lang.ClassLoader |
getClassLoader()
Return the Java class loader to be used by this Container. |
Container |
getContainer()
Return the Container with which this Logger has been associated. |
int |
getDebug()
Return the debugging detail level for this component. |
DefaultContext |
getDefaultContext()
Return the DefaultContext with which this Loader is associated. |
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. |
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 |
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 |
run()
The background thread that checks for session timeouts and shutdown. |
void |
setCheckInterval(int checkInterval)
Set the check interval for this Loader. |
void |
setContainer(Container container)
Set the Container with which this Logger has been associated. |
void |
setDebug(int debug)
Set the debugging detail level for this component. |
void |
setDefaultContext(DefaultContext defaultContext)
Set the DefaultContext with which this Loader is associated. |
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 |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected DefaultContext defaultContext
protected LifecycleSupport lifecycle
protected static final StringManager sm
protected java.beans.PropertyChangeSupport support
Constructor Detail |
public WebappLoader()
public WebappLoader(java.lang.ClassLoader parent)
parent
- The parent class loaderMethod Detail |
public int getCheckInterval()
public void setCheckInterval(int checkInterval)
checkInterval
- The new check intervalpublic java.lang.ClassLoader getClassLoader()
getClassLoader
in interface Loader
public Container getContainer()
getContainer
in interface Loader
public void setContainer(Container container)
setContainer
in interface Loader
container
- The associated Containerpublic DefaultContext getDefaultContext()
getDefaultContext
in interface Loader
public void setDefaultContext(DefaultContext defaultContext)
setDefaultContext
in interface Loader
defaultContext
- The newly associated DefaultContextpublic int getDebug()
public void setDebug(int debug)
debug
- The new debugging detail levelpublic boolean getDelegate()
getDelegate
in interface Loader
public void setDelegate(boolean delegate)
setDelegate
in interface Loader
delegate
- The new flagpublic java.lang.String getInfo()
<description>/<version>
.
getInfo
in interface Loader
public java.lang.String getLoaderClass()
public void setLoaderClass(java.lang.String loaderClass)
loaderClass
- The new ClassLoader class namepublic boolean getReloadable()
getReloadable
in interface Loader
public void setReloadable(boolean reloadable)
setReloadable
in interface Loader
reloadable
- The new reloadable flagpublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface Loader
listener
- The listener to addpublic void addRepository(java.lang.String repository)
addRepository
in interface Loader
repository
- Repository to be addedpublic java.lang.String[] findRepositories()
findRepositories
in interface Loader
public boolean modified()
modified
in interface Loader
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface Loader
listener
- The listener to removepublic java.lang.String toString()
public void addLifecycleListener(LifecycleListener listener)
addLifecycleListener
in interface Lifecycle
listener
- The listener to addpublic LifecycleListener[] findLifecycleListeners()
findLifecycleListeners
in interface Lifecycle
public void removeLifecycleListener(LifecycleListener listener)
removeLifecycleListener
in interface Lifecycle
listener
- The listener to removepublic void start() throws LifecycleException
start
in interface Lifecycle
LifecycleException
- if a lifecycle error occurspublic void stop() throws LifecycleException
stop
in interface Lifecycle
LifecycleException
- if a lifecycle error occurspublic void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
event
- The property change event that has occurredpublic void run()
run
in interface java.lang.Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |