org.eclipse.jetty.webapp
Class WebAppClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.eclipse.jetty.webapp.WebAppClassLoader
- Direct Known Subclasses:
- OSGiWebappClassLoader
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 behavior 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 and influenced with WebAppContext.isServerClass(String)
and
WebAppContext.isSystemClass(String)
.
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.
Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResourceAsStream, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
WebAppClassLoader
public WebAppClassLoader(WebAppClassLoader.Context context)
throws IOException
- Constructor.
- Throws:
IOException
WebAppClassLoader
public WebAppClassLoader(ClassLoader parent,
WebAppClassLoader.Context context)
throws IOException
- Constructor.
- Throws:
IOException
getName
public String getName()
- Returns:
- the name of the classloader
setName
public void setName(String name)
- Parameters:
name
- the name of the classloader
getContext
public WebAppClassLoader.Context getContext()
addClassPath
public void addClassPath(Resource resource)
throws IOException
- Parameters:
resource
- Comma or semicolon separated path of filenames or URLs
pointing to directories or jar files. Directories should end
with '/'.
- Throws:
IOException
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.
getPermissions
public PermissionCollection getPermissions(CodeSource cs)
- Overrides:
getPermissions
in class URLClassLoader
getResources
public Enumeration<URL> getResources(String name)
throws IOException
- Overrides:
getResources
in class ClassLoader
- Throws:
IOException
getResource
public URL getResource(String name)
- Overrides:
getResource
in class ClassLoader
loadClass
public Class<?> loadClass(String name)
throws ClassNotFoundException
- Overrides:
loadClass
in class ClassLoader
- Throws:
ClassNotFoundException
loadClass
protected Class<?> loadClass(String name,
boolean resolve)
throws ClassNotFoundException
- Overrides:
loadClass
in class ClassLoader
- Throws:
ClassNotFoundException
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 1995-2011 Mort Bay Consulting. All Rights Reserved.