public class OSGiWebappClassLoader extends WebAppClassLoader implements org.osgi.framework.BundleReference
WebAppClassLoader.Context| Modifier and Type | Field and Description |
|---|---|
static Set<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(ClassLoader parent,
WebAppContext context,
org.osgi.framework.Bundle contributor) |
| Modifier and Type | Method and Description |
|---|---|
void |
addClassPath(String classPath)
Parse the classpath ourselves to be able to filter things.
|
static void |
addClassThatIdentifiesAJarThatMustBeRejected(Class<?> zclass) |
static void |
addClassThatIdentifiesAJarThatMustBeRejected(String zclassName) |
protected Class<?> |
findClass(String name) |
org.osgi.framework.Bundle |
getBundle()
Returns the
Bundle that defined this web-application. |
URL |
getResource(String name)
Get a resource from the classloader
NOTE: this method provides a convenience of hacking off a leading /
should one be present.
|
Enumeration<URL> |
getResources(String name) |
Class<?> |
loadClass(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.
|
addClassFileTransformer, addClassPath, addJars, addTransformer, getContext, getName, getPermissions, loadClass, removeClassFileTransformer, removeTransformer, setName, toStringaddURL, close, definePackage, findResource, findResources, getResourceAsStream, getURLs, newInstance, newInstancedefineClass, defineClassclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignerspublic OSGiWebappClassLoader(ClassLoader parent, WebAppContext context, org.osgi.framework.Bundle contributor) throws IOException
parent - The parent classloader.context - The WebAppContextcontributor - The bundle that defines this web-application.IOExceptionpublic static void addClassThatIdentifiesAJarThatMustBeRejected(Class<?> zclass)
public static void addClassThatIdentifiesAJarThatMustBeRejected(String zclassName)
public Class<?> loadClass(String name) throws ClassNotFoundException
loadClass in class WebAppClassLoaderClassNotFoundExceptionpublic org.osgi.framework.Bundle getBundle()
Bundle that defined this web-application.getBundle in interface org.osgi.framework.BundleReferenceBundle object associated with this
BundleReference.public Enumeration<URL> getResources(String name) throws IOException
getResources in class WebAppClassLoaderIOExceptionpublic URL getResource(String name)
WebAppClassLoadergetResource in class WebAppClassLoaderprotected Class<?> findClass(String name) throws ClassNotFoundException
findClass in class WebAppClassLoaderClassNotFoundExceptionpublic void addClassPath(String classPath) throws IOException
addClassPath in class WebAppClassLoaderclassPath - Comma or semicolon separated path of filenames or URLs
pointing to directories or jar files. Directories should end
with '/'.IOExceptionpublic void setWebappContext(WebAppContext webappContext)
Copyright © 1995-2015 Webtide. All Rights Reserved.