public class OSGiWebappClassLoader extends WebAppClassLoader implements org.osgi.framework.BundleReference
WebAppClassLoader.Context| Modifier and Type | Field and Description |
|---|---|
static java.util.Set<java.lang.String> |
JAR_WITH_SUCH_CLASS_MUST_BE_EXCLUDED
when a logging framework is setup in the osgi classloaders, it can access
this and register the classes that must not be found in the jar.
|
| Constructor and Description |
|---|
OSGiWebappClassLoader(java.lang.ClassLoader parent,
WebAppContext context,
org.osgi.framework.Bundle contributor) |
| Modifier and Type | Method and Description |
|---|---|
void |
addClassPath(java.lang.String classPath)
Parse the classpath ourselves to be able to filter things.
|
static void |
addClassThatIdentifiesAJarThatMustBeRejected(java.lang.Class<?> zclass) |
static void |
addClassThatIdentifiesAJarThatMustBeRejected(java.lang.String zclassName) |
protected java.lang.Class<?> |
findClass(java.lang.String name) |
org.osgi.framework.Bundle |
getBundle()
Returns the
Bundle that defined this web-application. |
java.net.URL |
getResource(java.lang.String name) |
java.util.Enumeration<java.net.URL> |
getResources(java.lang.String name) |
void |
setWebappContext(WebAppContext webappContext)
In the case of the generation of a webapp via a jetty context file we
need a proper classloader to setup the app before we have the
WebappContext So we place a fake one there to start with.
|
addClassPath, addJars, getContext, getName, getPermissions, loadClass, loadClass, setName, toStringaddURL, close, definePackage, 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 static java.util.Set<java.lang.String> JAR_WITH_SUCH_CLASS_MUST_BE_EXCLUDED
public OSGiWebappClassLoader(java.lang.ClassLoader parent,
WebAppContext context,
org.osgi.framework.Bundle contributor)
throws java.io.IOException
parent - The parent classloader. In this casecontext - The WebAppContextcontributor - The bundle that defines this web-application.java.io.IOExceptionpublic static void addClassThatIdentifiesAJarThatMustBeRejected(java.lang.Class<?> zclass)
public static void addClassThatIdentifiesAJarThatMustBeRejected(java.lang.String zclassName)
public org.osgi.framework.Bundle getBundle()
Bundle that defined this web-application.getBundle in interface org.osgi.framework.BundleReferenceBundle object associated with this
BundleReference.public java.util.Enumeration<java.net.URL> getResources(java.lang.String name)
throws java.io.IOException
getResources in class WebAppClassLoaderjava.io.IOExceptionpublic java.net.URL getResource(java.lang.String name)
getResource in class WebAppClassLoaderprotected java.lang.Class<?> findClass(java.lang.String name)
throws java.lang.ClassNotFoundException
findClass in class java.net.URLClassLoaderjava.lang.ClassNotFoundExceptionpublic void addClassPath(java.lang.String classPath)
throws java.io.IOException
addClassPath in class WebAppClassLoaderjava.io.IOExceptionpublic void setWebappContext(WebAppContext webappContext)
Copyright © 2013 FuseSource, Corp.. All Rights Reserved.