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

## org.mortbay.jetty.webapp
Class WebAppClassLoader

    java.lang.Object
      java.lang.ClassLoader
          java.security.SecureClassLoader
              java.net.URLClassLoader
                  org.mortbay.jetty.webapp.WebAppClassLoader

    public class WebAppClassLoader

extends java.net.URLClassLoader

ClassLoader for HttpContext. Specializes URLClassLoader with some utility and file mapping methods. This loader defaults to the 2.3 servlet spec behaviour where non system classes are loaded from the classpath in preference to the parent loader. Java2 compliant loading, where the parent loader always has priority, can be selected with the `WebAppContext.setParentLoaderPriority(boolean)` method. If no parent class loader is provided, then the current thread context classloader will be used. If that is null then the classloader that loaded this class is used as the parent.

Author:
  Greg Wilkins (gregw)

Constructor Summary
`WebAppClassLoader(java.lang.ClassLoader parent, WebAppContext context)` Constructor.
`WebAppClassLoader(WebAppContext context)` Constructor.

Method Summary
`void` | `addClassPath(java.lang.String classPath)`
`void` | `addJars(Resource lib)` Add elements to the class path for the context from the jar and zip files found in the specified resource.
`void` | `destroy()`
`ContextHandler` | `getContext()`
`java.lang.String` | `getName()`
`java.security.PermissionCollection` | `getPermissions(java.security.CodeSource cs)`
`java.net.URL` | `getResource(java.lang.String name)`
`boolean` | `isServerPath(java.lang.String name)`
`boolean` | `isSystemPath(java.lang.String name)`
`java.lang.Class` | `loadClass(java.lang.String name)`
`protected java.lang.Class` | `loadClass(java.lang.String name, boolean resolve)`
`void` | `setName(java.lang.String name)`
`java.lang.String` | `toString()`

Methods inherited from class java.net.URLClassLoader
`addURL, definePackage, findClass, findResource, findResources, getURLs, newInstance, newInstance`

Methods inherited from class java.security.SecureClassLoader
`defineClass, defineClass`

Methods inherited from class java.lang.ClassLoader
`clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners`

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

Constructor Detail

### WebAppClassLoader

    public WebAppClassLoader(WebAppContext context)
                      throws java.io.IOException

  Constructor.

  Throws:
    `java.io.IOException`

### WebAppClassLoader

    public WebAppClassLoader(java.lang.ClassLoader parent,
                             WebAppContext context)
                      throws java.io.IOException

  Constructor.

  Throws:
    `java.io.IOException`

Method Detail

### getName

    public java.lang.String getName()

  Returns:
    the name of the classloader

### setName

    public void setName(java.lang.String name)

  Parameters:
    `name` - the name of the classloader

### getContext

    public ContextHandler getContext()

### addClassPath

    public void addClassPath(java.lang.String classPath)
                      throws java.io.IOException

  Parameters:
    `classPath` - Comma or semicolon separated path of filenames or URLs pointing to directories or jar files. Directories should end with '/'.
  Throws:
    `java.io.IOException`

### addJars

    public void addJars(Resource lib)

  Add elements to the class path for the context from the jar and zip files found in the specified resource.

  Parameters:
    `lib` - the resource that contains the jar and/or zip files.
    `append` - true if the classpath entries are to be appended to any existing classpath, or false if they replace the existing classpath.
  See Also:
    `#setClassPath(String)`

### destroy

    public void destroy()

### getPermissions

    public java.security.PermissionCollection getPermissions(java.security.CodeSource cs)

  Overrides:
    `getPermissions` in class `java.net.URLClassLoader`

### getResource

    public java.net.URL getResource(java.lang.String name)

  Overrides:
    `getResource` in class `java.lang.ClassLoader`

### isServerPath

    public boolean isServerPath(java.lang.String name)

### isSystemPath

    public boolean isSystemPath(java.lang.String name)

### loadClass

    public java.lang.Class loadClass(java.lang.String name)
                              throws java.lang.ClassNotFoundException

  Overrides:
    `loadClass` in class `java.lang.ClassLoader`
  Throws:
    `java.lang.ClassNotFoundException`

### loadClass

    protected java.lang.Class loadClass(java.lang.String name,
                                        boolean resolve)
                                 throws java.lang.ClassNotFoundException

  Overrides:
    `loadClass` in class `java.lang.ClassLoader`
  Throws:
    `java.lang.ClassNotFoundException`

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

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

Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.