public class WebAppClassLoader extends URLClassLoader
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.| Constructor and Description |
|---|
WebAppClassLoader(ClassLoader parent,
WebAppContext context)
Constructor.
|
WebAppClassLoader(WebAppContext context)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addClassPath(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() |
String |
getName() |
PermissionCollection |
getPermissions(CodeSource cs) |
URL |
getResource(String name) |
boolean |
isServerPath(String name) |
boolean |
isSystemPath(String name) |
Class |
loadClass(String name) |
protected Class |
loadClass(String name,
boolean resolve) |
void |
setName(String name) |
String |
toString() |
addURL, close, definePackage, findClass, findResource, findResources, getResourceAsStream, getURLs, newInstance, newInstancedefineClass, defineClassclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignerspublic WebAppClassLoader(WebAppContext context) throws IOException
IOExceptionpublic WebAppClassLoader(ClassLoader parent, WebAppContext context) throws IOException
IOExceptionpublic String getName()
public void setName(String name)
name - the name of the classloaderpublic ContextHandler getContext()
public void addClassPath(String classPath) throws IOException
classPath - Comma or semicolon separated path of filenames or URLs
pointing to directories or jar files. Directories should end
with '/'.IOExceptionpublic void addJars(Resource lib)
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.#setClassPath(String)public void destroy()
public PermissionCollection getPermissions(CodeSource cs)
getPermissions in class URLClassLoaderpublic URL getResource(String name)
getResource in class ClassLoaderpublic boolean isServerPath(String name)
public boolean isSystemPath(String name)
public Class loadClass(String name) throws ClassNotFoundException
loadClass in class ClassLoaderClassNotFoundExceptionprotected Class loadClass(String name, boolean resolve) throws ClassNotFoundException
loadClass in class ClassLoaderClassNotFoundExceptionCopyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.