public class WebAppClassLoader
extends java.net.URLClassLoader
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.| Modifier and Type | Class and Description |
|---|---|
static interface |
WebAppClassLoader.Context
The Context in which the classloader operates.
|
| Constructor and Description |
|---|
WebAppClassLoader(java.lang.ClassLoader parent,
WebAppClassLoader.Context context)
Constructor.
|
WebAppClassLoader(WebAppClassLoader.Context context)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addClassPath(Resource resource) |
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.
|
WebAppClassLoader.Context |
getContext() |
java.lang.String |
getName() |
java.security.PermissionCollection |
getPermissions(java.security.CodeSource cs) |
java.net.URL |
getResource(java.lang.String name)
Get a resource from the classloader
NOTE: this method provides a convenience of hacking off a leading /
should one be present.
|
java.util.Enumeration<java.net.URL> |
getResources(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() |
addURL, close, definePackage, findClass, findResource, findResources, getResourceAsStream, getURLs, newInstance, newInstanceclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignerspublic WebAppClassLoader(WebAppClassLoader.Context context) throws java.io.IOException
java.io.IOExceptionpublic WebAppClassLoader(java.lang.ClassLoader parent,
WebAppClassLoader.Context context)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getName()
public void setName(java.lang.String name)
name - the name of the classloaderpublic WebAppClassLoader.Context getContext()
public void addClassPath(Resource resource) throws java.io.IOException
resource - Comma or semicolon separated path of filenames or URLs
pointing to directories or jar files. Directories should end
with '/'.java.io.IOExceptionpublic void addClassPath(java.lang.String classPath)
throws java.io.IOException
classPath - Comma or semicolon separated path of filenames or URLs
pointing to directories or jar files. Directories should end
with '/'.java.io.IOExceptionpublic void addJars(Resource lib)
lib - the resource that contains the jar and/or zip files.public java.security.PermissionCollection getPermissions(java.security.CodeSource cs)
getPermissions in class java.net.URLClassLoaderpublic java.util.Enumeration<java.net.URL> getResources(java.lang.String name)
throws java.io.IOException
getResources in class java.lang.ClassLoaderjava.io.IOExceptionpublic java.net.URL getResource(java.lang.String name)
getResource in class java.lang.ClassLoaderpublic java.lang.Class<?> loadClass(java.lang.String name)
throws java.lang.ClassNotFoundException
loadClass in class java.lang.ClassLoaderjava.lang.ClassNotFoundExceptionprotected java.lang.Class<?> loadClass(java.lang.String name,
boolean resolve)
throws java.lang.ClassNotFoundException
loadClass in class java.lang.ClassLoaderjava.lang.ClassNotFoundExceptionpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2013 FuseSource, Corp.. All Rights Reserved.