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) |
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, toString
addURL, close, definePackage, findResource, findResources, getResourceAsStream, getURLs, newInstance, newInstance
defineClass, defineClass
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public OSGiWebappClassLoader(ClassLoader parent, WebAppContext context, org.osgi.framework.Bundle contributor) throws IOException
parent
- The parent classloader. In this casecontext
- The WebAppContextcontributor
- The bundle that defines this web-application.IOException
public static void addClassThatIdentifiesAJarThatMustBeRejected(Class<?> zclass)
public static void addClassThatIdentifiesAJarThatMustBeRejected(String zclassName)
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 Enumeration<URL> getResources(String name) throws IOException
getResources
in class WebAppClassLoader
IOException
public URL getResource(String name)
WebAppClassLoader
getResource
in class WebAppClassLoader
protected Class<?> findClass(String name) throws ClassNotFoundException
findClass
in class URLClassLoader
ClassNotFoundException
public void addClassPath(String classPath) throws 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 '/'.IOException
public void setWebappContext(WebAppContext webappContext)
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.