Overview | Package | Class | Tree | Deprecated | Index | Help
| Apache Tomcat 6.0.32
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.catalina.loader
Class VirtualWebappLoader

    java.lang.Object
      org.apache.catalina.loader.WebappLoader
          org.apache.catalina.loader.VirtualWebappLoader

All Implemented Interfaces:
  java.beans.PropertyChangeListener, java.util.EventListener, javax.management.MBeanRegistration, Lifecycle, Loader

    public class VirtualWebappLoader

extends WebappLoader

A WebappLoader that allows a customized classpath to be added through configuration in context xml. Any additional classpath entry will be added to the default webapp classpath, making easy to emulate a standard webapp without the need for assembly all the webapp dependencies as jars in WEB-INF/lib.

     <Context docBase="\webapps\mydocbase">
       <Loader className="org.apache.catalina.loader.VirtualWebappLoader"
                  virtualClasspath="/dir/classes;/somedir/somejar.jar;/somedir/*.jar"/>
     </Context>

This is not meant to be used for production. Its meant to ease development with IDE's without the need for fully republishing jars in WEB-INF/lib

The `*.jar` suffix can be used to include all JAR files in a certain directory. If a file or a directory does not exist, it will be skipped.

Version:
  $Id: VirtualWebappLoader.java 964763 2010-07-16 11:13:37Z rjung $
Author:
  Fabrizio Giustina

Field Summary

Fields inherited from class org.apache.catalina.loader.WebappLoader
`lifecycle, sm, support`

Fields inherited from interface org.apache.catalina.Lifecycle
`AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, DESTROY_EVENT, INIT_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT`

Constructor Summary
`VirtualWebappLoader()` Construct a new WebappLoader with no defined parent class loader (so that the actual parent will be the system class loader).
`VirtualWebappLoader(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` | `setVirtualClasspath(java.lang.String path)` `virtualClasspath` attribute that will be automatically set from the `Context` `virtualClasspath` attribute from the context xml file.
`void` | `start()` Start this component, initializing our associated class loader.

Methods inherited from class org.apache.catalina.loader.WebappLoader
`addLifecycleListener, addPropertyChangeListener, addRepository, backgroundProcess, closeJARs, destroy, findLifecycleListeners, findRepositories, getClassLoader, getClasspath, getContainer, getController, getDelegate, getInfo, getLoaderClass, getLoaderRepositories, getLoaderRepositoriesString, getReloadable, getRepositories, getRepositoriesString, getSearchExternalFirst, init, modified, postDeregister, postRegister, preDeregister, preRegister, propertyChange, removeLifecycleListener, removePropertyChangeListener, setContainer, setController, setDelegate, setLoaderClass, setReloadable, setSearchExternalFirst, stop, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### VirtualWebappLoader

    public VirtualWebappLoader()

  Construct a new WebappLoader with no defined parent class loader (so that the actual parent will be the system class loader).

### VirtualWebappLoader

    public VirtualWebappLoader(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.

  Parameters:
    `parent` - The parent class loader

Method Detail

### setVirtualClasspath

    public void setVirtualClasspath(java.lang.String path)

  `virtualClasspath` attribute that will be automatically set from the `Context` `virtualClasspath` attribute from the context xml file.

  Parameters:
    `path` - `;` separated list of path elements.

### start

    public void start()
               throws LifecycleException

  Description copied from class: `WebappLoader`
  Start this component, initializing our associated class loader.

  Specified by:
    `start` in interface `Lifecycle`
  Overrides:
    `start` in class `WebappLoader`
  Throws:
    `LifecycleException` - if a lifecycle error occurs

Overview | Package | Class | Tree | Deprecated | Index | Help
| Apache Tomcat 6.0.32
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.