public class WebappLoader extends LifecycleMBeanBase implements Loader
WebResourceRoot).
This class loader supports detection of modified
Java classes, which can be used to implement auto-reload support.
This class loader is configured via the Resources children of its Context
prior to calling start(). When a new class is required,
these Resources will be consulted first to locate the class. If it
is not present, the system class loader will be used instead.
Lifecycle.SingleUse| Modifier and Type | Field and Description |
|---|---|
protected static StringManager |
sm
The string manager for this package.
|
protected PropertyChangeSupport |
support
The property change support for this component.
|
AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT| Constructor and Description |
|---|
WebappLoader() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a property change listener to this component.
|
void |
backgroundProcess()
Execute a periodic task, such as reloading, etc.
|
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
|
Context |
getContext() |
boolean |
getDelegate()
Return the "follow standard delegation model" flag used to configure
our ClassLoader.
|
protected String |
getDomainInternal()
Method implemented by sub-classes to identify the domain in which MBeans
should be registered.
|
String |
getJakartaConverter() |
String |
getLoaderClass() |
String[] |
getLoaderRepositories() |
String |
getLoaderRepositoriesString() |
protected String |
getObjectNameKeyProperties()
Allow sub-classes to specify the key properties component of the
ObjectName that will be used to register this component. |
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 |
setContext(Context context)
Set the Context with which this Loader has been associated.
|
void |
setDelegate(boolean delegate)
Set the "follow standard delegation model" flag used to configure
our ClassLoader.
|
void |
setJakartaConverter(String jakartaConverter)
Set the Jakarta converter.
|
void |
setLoaderClass(String loaderClass)
Set the ClassLoader class name.
|
void |
setLoaderInstance(WebappClassLoaderBase loaderInstance)
Set the ClassLoader instance, without relying on reflection
This method will also invoke
setLoaderClass(String) with
loaderInstance.getClass().getName() as an argument |
protected void |
startInternal()
Start associated
ClassLoader and implement the requirements
of LifecycleBase.startInternal(). |
protected void |
stopInternal()
Stop associated
ClassLoader and implement the requirements
of LifecycleBase.stopInternal(). |
String |
toString()
Return a String representation of this component.
|
destroyInternal, getDomain, getObjectName, initInternal, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregisteraddLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stopprotected static final StringManager sm
protected final PropertyChangeSupport support
public ClassLoader getClassLoader()
getClassLoader in interface Loaderpublic Context getContext()
getContext in interface Loaderpublic void setContext(Context context)
LoadersetContext in interface Loadercontext - The associated Contextpublic boolean getDelegate()
getDelegate in interface Loaderpublic void setDelegate(boolean delegate)
setDelegate in interface Loaderdelegate - The new flagpublic String getJakartaConverter()
public void setJakartaConverter(String jakartaConverter)
jakartaConverter - The profile name which will be used by the converter
Any invalid profile value will default to the TOMCAT profile, which
converts all packages used by Tomcat.public String getLoaderClass()
public void setLoaderClass(String loaderClass)
loaderClass - The new ClassLoader class namepublic void setLoaderInstance(WebappClassLoaderBase loaderInstance)
setLoaderClass(String) with
loaderInstance.getClass().getName() as an argumentloaderInstance - The new ClassLoader instance to usepublic void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener in interface Loaderlistener - The listener to addpublic void backgroundProcess()
backgroundProcess in interface Loaderpublic String[] getLoaderRepositories()
public String getLoaderRepositoriesString()
public String getClasspath()
public boolean modified()
public void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener in interface Loaderlistener - The listener to removepublic String toString()
protected void startInternal()
throws LifecycleException
ClassLoader and implement the requirements
of LifecycleBase.startInternal().startInternal in class LifecycleBaseLifecycleException - if this component detects a fatal error
that prevents this component from being usedprotected void stopInternal()
throws LifecycleException
ClassLoader and implement the requirements
of LifecycleBase.stopInternal().stopInternal in class LifecycleBaseLifecycleException - if this component detects a fatal error
that prevents this component from being usedprotected String getDomainInternal()
LifecycleMBeanBasegetDomainInternal in class LifecycleMBeanBaseprotected String getObjectNameKeyProperties()
LifecycleMBeanBaseObjectName that will be used to register this component.getObjectNameKeyProperties in class LifecycleMBeanBaseObjectNameCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.