org.eclipse.jetty.osgi.boot.internal.webapp
Class OSGiWebappClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.eclipse.jetty.webapp.WebAppClassLoader
org.eclipse.jetty.osgi.boot.internal.webapp.OSGiWebappClassLoader
- All Implemented Interfaces:
- org.osgi.framework.BundleReference
public class OSGiWebappClassLoader
- extends WebAppClassLoader
- implements org.osgi.framework.BundleReference
Extends the webappclassloader to insert the classloader provided by the osgi
bundle at the same level than any other jars palced in the webappclassloader.
Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResourceAsStream, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
JAR_WITH_SUCH_CLASS_MUST_BE_EXCLUDED
public 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.
OSGiWebappClassLoader
public OSGiWebappClassLoader(ClassLoader parent,
WebAppContext context,
org.osgi.framework.Bundle contributor,
BundleClassLoaderHelper bundleClassLoaderHelper)
throws IOException
- Parameters:
parent
- The parent classloader. In this casecontext
- The WebAppContextcontributor
- The bundle that defines this web-application.
- Throws:
IOException
addClassThatIdentifiesAJarThatMustBeRejected
public static void addClassThatIdentifiesAJarThatMustBeRejected(Class<?> zclass)
addClassThatIdentifiesAJarThatMustBeRejected
public static void addClassThatIdentifiesAJarThatMustBeRejected(String zclassName)
getBundle
public org.osgi.framework.Bundle getBundle()
- Returns the
Bundle
that defined this web-application.
- Specified by:
getBundle
in interface org.osgi.framework.BundleReference
- Returns:
- The
Bundle
object associated with this
BundleReference
.
getResources
public Enumeration<URL> getResources(String name)
throws IOException
- Overrides:
getResources
in class WebAppClassLoader
- Throws:
IOException
getResource
public URL getResource(String name)
- Overrides:
getResource
in class WebAppClassLoader
findClass
protected Class<?> findClass(String name)
throws ClassNotFoundException
- Overrides:
findClass
in class URLClassLoader
- Throws:
ClassNotFoundException
addClassPath
public void addClassPath(String classPath)
throws IOException
- Parse the classpath ourselves to be able to filter things. This is a
derivative work of the super class
- Overrides:
addClassPath
in class WebAppClassLoader
- Parameters:
classPath
- Comma or semicolon separated path of filenames or URLs
pointing to directories or jar files. Directories should end
with '/'.
- Throws:
IOException
setWebappContext
public 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. We replace it
with the actual webapp context with this method. We also apply the
extraclasspath there at the same time.
Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.