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) |
java.net.URL |
findResource(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)
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) |
protected java.lang.Class<?> |
loadAsResource(java.lang.String name,
boolean checkSystemResource)
Try to load the class from the bundle classloader.
|
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, close, foundClass, getContext, getName, getPermissions, loadClass, removeClassFileTransformer, removeTransformer, runWithServerClassAccess, setName, toStringaddURL, definePackage, findResources, getProtectionDomainInternal, getResourceAsStream, getURLs, newInstance, newInstancedefineClass, defineClass, getProtectionDomainclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignerspublic static final 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.context - The WebAppContextcontributor - The bundle that defines this web-application.java.io.IOException - if unable to cerate the OSGiWebappClassLoaderpublic static void addClassThatIdentifiesAJarThatMustBeRejected(java.lang.Class<?> zclass)
public static void addClassThatIdentifiesAJarThatMustBeRejected(java.lang.String zclassName)
protected java.lang.Class<?> findClass(java.lang.String name)
throws java.lang.ClassNotFoundException
findClass in class WebAppClassLoaderjava.lang.ClassNotFoundExceptionpublic 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)
WebAppClassLoadergetResource in class WebAppClassLoaderpublic java.net.URL findResource(java.lang.String name)
findResource in class java.net.URLClassLoaderprotected java.lang.Class<?> loadAsResource(java.lang.String name,
boolean checkSystemResource)
throws java.lang.ClassNotFoundException
loadAsResource in class WebAppClassLoadername - the name of the class to loadcheckSystemResource - if true and the class isn't a system class we return itjava.lang.ClassNotFoundExceptionWebAppClassLoader.loadAsResource(java.lang.String, boolean)public void addClassPath(java.lang.String classPath)
throws java.io.IOException
addClassPath in class WebAppClassLoaderclassPath - Comma or semicolon separated path of filenames or URLs
pointing to directories or jar files. Directories should end
with '/'.java.io.IOException - if unable to add classpathpublic void setWebappContext(WebAppContext webappContext)
webappContext - the web app contextCopyright © 1995–2023 Webtide. All rights reserved.