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.
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
Add a property change listener to this component.
- addPropertyChangeListener in interface Loader
listener
- The listener to add
addRepository
public void addRepository(String repository)
Add a new repository to the set of repositories for this class loader.
- addRepository in interface Loader
repository
- Repository to be added
closeJARs
public void closeJARs(boolean force)
Used to periodically signal to the classloader to release JAR resources.
destroy
public void destroy()
findLifecycleListeners
public LifecycleListener[] findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle. If this
Lifecycle has no listeners registered, a zero-length array is returned.
- findLifecycleListeners in interface Lifecycle
findRepositories
public String[] findRepositories()
Return the set of repositories defined for this class loader.
If none are defined, a zero-length array is returned.
For security reason, returns a clone of the Array (since
String are immutable).
- findRepositories in interface Loader
getClassLoader
public ClassLoader getClassLoader()
Return the Java class loader to be used by this Container.
- getClassLoader in interface Loader
getClasspath
public String getClasspath()
Classpath, as set in org.apache.catalina.jsp_classpath context
property
- The classpath
getContainer
public Container getContainer()
Return the Container with which this Logger has been associated.
- getContainer in interface Loader
getController
public ObjectName getController()
getDebug
public int getDebug()
Return the debugging detail level for this component.
getDelegate
public boolean getDelegate()
Return the "follow standard delegation model" flag used to configure
our ClassLoader.
- getDelegate in interface Loader
getInfo
public String getInfo()
Return descriptive information about this Loader implementation and
the corresponding version number, in the format
<description>/<version>
.
- getInfo in interface Loader
getLoaderClass
public String getLoaderClass()
Return the ClassLoader class name.
getLoaderRepositories
public String[] getLoaderRepositories()
getLoaderRepositoriesString
public String getLoaderRepositoriesString()
getReloadable
public boolean getReloadable()
Return the reloadable flag for this Loader.
- getReloadable in interface Loader
getRepositories
public String[] getRepositories()
getRepositoriesString
public String getRepositoriesString()
Extra repositories 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?
- modified in interface Loader
postDeregister
public void postDeregister()
postRegister
public void postRegister(Boolean registrationDone)
preDeregister
public void preDeregister()
throws Exception
preRegister
public ObjectName preRegister(MBeanServer server,
ObjectName name)
throws Exception
propertyChange
public void propertyChange(PropertyChangeEvent event)
Process property change events from our associated Context.
event
- The property change event that has occurred
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
Remove a property change listener from this component.
- removePropertyChangeListener in interface Loader
listener
- The listener to remove
setContainer
public void setContainer(Container container)
Set the Container with which this Logger has been associated.
- setContainer in interface Loader
container
- The associated Container
setController
public void setController(ObjectName controller)
setDebug
public void setDebug(int debug)
Set the debugging detail level for this component.
debug
- The new debugging detail level
setDefaultContext
public void setDefaultContext(DefaultContext defaultContext)
Set the DefaultContext with which this Loader is associated.
- setDefaultContext in interface Loader
defaultContext
- The newly associated DefaultContext
setDelegate
public void setDelegate(boolean delegate)
Set the "follow standard delegation model" flag used to configure
our ClassLoader.
- setDelegate in interface Loader
delegate
- The new flag
setLoaderClass
public void setLoaderClass(String loaderClass)
Set the ClassLoader class name.
loaderClass
- The new ClassLoader class name
setReloadable
public void setReloadable(boolean reloadable)
Set the reloadable flag for this Loader.
- setReloadable in interface Loader
reloadable
- The new reloadable flag
toString
public String toString()
Return a String representation of this component.