org.osgi.framework.BundleReference
public class OSGiWebappClassLoader extends WebAppClassLoader implements org.osgi.framework.BundleReference
WebAppClassLoader.Context
Modifier and Type | Field | 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 | Description |
---|---|
OSGiWebappClassLoader(java.lang.ClassLoader parent,
WebAppContext context,
org.osgi.framework.Bundle contributor) |
Modifier and Type | Method | 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) |
|
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) |
|
java.lang.Class<?> |
loadClass(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.
|
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getPackage, getPackages, getParent, getPlatformClassLoader, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addURL, definePackage, findResource, findResources, getResourceAsStream, getURLs, newInstance, newInstance
addClassFileTransformer, addClassPath, addJars, addTransformer, close, findClass, foundClass, getContext, getName, getPermissions, loadClass, removeClassFileTransformer, removeTransformer, runWithServerClassAccess, setName, toString
public 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)
public java.lang.Class<?> loadClass(java.lang.String name) throws java.lang.ClassNotFoundException
loadClass
in class java.lang.ClassLoader
java.lang.ClassNotFoundException
public org.osgi.framework.Bundle getBundle()
Bundle
that defined this web-application.getBundle
in interface org.osgi.framework.BundleReference
Bundle
object associated with this
BundleReference
.public java.util.Enumeration<java.net.URL> getResources(java.lang.String name) throws java.io.IOException
getResources
in class WebAppClassLoader
java.io.IOException
public java.net.URL getResource(java.lang.String name)
WebAppClassLoader
getResource
in class WebAppClassLoader
public void addClassPath(java.lang.String classPath) throws java.io.IOException
addClassPath
in class WebAppClassLoader
classPath
- 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–2018 Webtide. All rights reserved.