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 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.
- Author:
- Greg Wilkins (gregw)
Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
WebAppClassLoader
public WebAppClassLoader(ClassLoader parent,
WebAppContext context)
- Constructor.
addClassPath
public void addClassPath(String classPath)
throws IOException
- Parameters:
classPath
- Comma or semicolon separated path of filenames or URLs
pointing to directories or jar files. Directories should end
with '/'.
- Throws:
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.- See Also:
#setClassPath(String)
destroy
public void destroy()
getPermissions
public PermissionCollection getPermissions(CodeSource cs)
getResource
public URL getResource(String name)
getUrlClassPath
public String getUrlClassPath()
- Returns:
- Returns the urlClassPath.
isServerPath
public boolean isServerPath(String name)
isSystemPath
public boolean isSystemPath(String name)
loadClass
public Class loadClass(String name)
throws ClassNotFoundException
- Throws:
ClassNotFoundException
loadClass
protected Class loadClass(String name,
boolean resolve)
throws ClassNotFoundException
- Throws:
ClassNotFoundException
toString
public String toString()