Class OSGiClassLoader
- java.lang.Object
-
- java.lang.ClassLoader
-
- java.security.SecureClassLoader
-
- java.net.URLClassLoader
-
- org.eclipse.jetty.osgi.boot.utils.OSGiClassLoader
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class OSGiClassLoader extends java.net.URLClassLoader
OSGiClassLoader Class loader that is aware of a bundle. Similar to WebAppClassLoader from Jetty and the OSGiWebAppClassLoader, but works without webapps.
-
-
Constructor Summary
Constructors Constructor Description OSGiClassLoader(java.lang.ClassLoader parent, org.osgi.framework.Bundle bundle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Class<?>
findClass(java.lang.String name)
java.net.URL
getResource(java.lang.String name)
Get a resource from the classloader Copied from WebAppClassLoaderjava.util.Enumeration<java.net.URL>
getResources(java.lang.String name)
java.lang.Class<?>
loadClass(java.lang.String name)
protected java.lang.Class<?>
loadClass(java.lang.String name, boolean resolve)
-
Methods inherited from class java.net.URLClassLoader
addURL, close, definePackage, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstance
-
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
-
-
-
Method Detail
-
getResource
public java.net.URL getResource(java.lang.String name)
Get a resource from the classloader Copied from WebAppClassLoader- Overrides:
getResource
in classjava.lang.ClassLoader
-
loadClass
public java.lang.Class<?> loadClass(java.lang.String name) throws java.lang.ClassNotFoundException
- Overrides:
loadClass
in classjava.lang.ClassLoader
- Throws:
java.lang.ClassNotFoundException
-
loadClass
protected java.lang.Class<?> loadClass(java.lang.String name, boolean resolve) throws java.lang.ClassNotFoundException
- Overrides:
loadClass
in classjava.lang.ClassLoader
- Throws:
java.lang.ClassNotFoundException
-
getResources
public java.util.Enumeration<java.net.URL> getResources(java.lang.String name) throws java.io.IOException
- Overrides:
getResources
in classjava.lang.ClassLoader
- Throws:
java.io.IOException
-
findClass
protected java.lang.Class<?> findClass(java.lang.String name) throws java.lang.ClassNotFoundException
- Overrides:
findClass
in classjava.net.URLClassLoader
- Throws:
java.lang.ClassNotFoundException
-
-