Save This Page
Home » GWT-2009.11.30 » org.apache » catalina » loader » [javadoc | source]
org.apache.catalina.loader
public class: WebappLoader [javadoc | source]
java.lang.Object
   org.apache.catalina.loader.WebappLoader

All Implemented Interfaces:
    org.apache.catalina.Loader, PropertyChangeListener, MBeanRegistration, org.apache.catalina.Lifecycle

Direct Known Subclasses:
    VirtualWebappLoader

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.

Field Summary
protected  LifecycleSupport lifecycle    The lifecycle event support for this component. 
protected static final  StringManager sm    The string manager for this package. 
protected  PropertyChangeSupport support    The property change support for this component. 
Constructor:
 public WebappLoader() 
 public WebappLoader(ClassLoader parent) 
    Construct a new WebappLoader with the specified class loader to be defined as the parent of the ClassLoader we ultimately create.
    Parameters:
    parent - The parent class loader
Method from org.apache.catalina.loader.WebappLoader Summary:
addLifecycleListener,   addPropertyChangeListener,   addRepository,   backgroundProcess,   closeJARs,   destroy,   findLifecycleListeners,   findRepositories,   getClassLoader,   getClasspath,   getContainer,   getController,   getDelegate,   getInfo,   getLoaderClass,   getLoaderRepositories,   getLoaderRepositoriesString,   getReloadable,   getRepositories,   getRepositoriesString,   init,   modified,   postDeregister,   postRegister,   preDeregister,   preRegister,   propertyChange,   removeLifecycleListener,   removePropertyChangeListener,   setContainer,   setController,   setDelegate,   setLoaderClass,   setReloadable,   start,   stop,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.loader.WebappLoader Detail:
 public  void addLifecycleListener(LifecycleListener listener) 
    Add a lifecycle event listener to this component.
 public  void addPropertyChangeListener(PropertyChangeListener listener) 
    Add a property change listener to this component.
 public  void addRepository(String repository) 
    Add a new repository to the set of repositories for this class loader.
 public  void backgroundProcess() 
    Execute a periodic task, such as reloading, etc. This method will be invoked inside the classloading context of this container. Unexpected throwables will be caught and logged.
 public  void closeJARs(boolean force) 
    Used to periodically signal to the classloader to release JAR resources.
 public  void destroy() 
 public LifecycleListener[] findLifecycleListeners() 
    Get the lifecycle listeners associated with this lifecycle. If this Lifecycle has no listeners registered, a zero-length array is returned.
 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).
 public ClassLoader getClassLoader() 
    Return the Java class loader to be used by this Container.
 public String getClasspath() 
    Classpath, as set in org.apache.catalina.jsp_classpath context property
 public Container getContainer() 
    Return the Container with which this Logger has been associated.
 public ObjectName getController() 
 public boolean getDelegate() 
    Return the "follow standard delegation model" flag used to configure our ClassLoader.
 public String getInfo() 
    Return descriptive information about this Loader implementation and the corresponding version number, in the format <description>/<version>.
 public String getLoaderClass() 
    Return the ClassLoader class name.
 public String[] getLoaderRepositories() 
 public String getLoaderRepositoriesString() 
 public boolean getReloadable() 
    Return the reloadable flag for this Loader.
 public String[] getRepositories() 
 public String getRepositoriesString() 
    Extra repositories for this loader
 public  void init() 
 public boolean modified() 
    Has the internal repository associated with this Loader been modified, such that the loaded classes should be reloaded?
 public  void postDeregister() 
 public  void postRegister(Boolean registrationDone) 
 public  void preDeregister() throws Exception 
 public ObjectName preRegister(MBeanServer server,
    ObjectName name) throws Exception 
 public  void propertyChange(PropertyChangeEvent event) 
    Process property change events from our associated Context.
 public  void removeLifecycleListener(LifecycleListener listener) 
    Remove a lifecycle event listener from this component.
 public  void removePropertyChangeListener(PropertyChangeListener listener) 
    Remove a property change listener from this component.
 public  void setContainer(Container container) 
    Set the Container with which this Logger has been associated.
 public  void setController(ObjectName controller) 
 public  void setDelegate(boolean delegate) 
    Set the "follow standard delegation model" flag used to configure our ClassLoader.
 public  void setLoaderClass(String loaderClass) 
    Set the ClassLoader class name.
 public  void setReloadable(boolean reloadable) 
    Set the reloadable flag for this Loader.
 public  void start() throws LifecycleException 
    Start this component, initializing our associated class loader.
 public  void stop() throws LifecycleException 
    Stop this component, finalizing our associated class loader.
 public String toString() 
    Return a String representation of this component.