public final class BundleClassLoader extends java.lang.ClassLoader implements BundleReference
Modifier and Type | Field and Description |
---|---|
protected static org.knopflerfish.framework.BundleClassLoader.SecurityManagerExposer |
smex |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Class<?> |
findClass(java.lang.String name)
Find bundle class to load.
|
protected java.lang.String |
findLibrary(java.lang.String name)
Find native library code to load.
|
protected java.net.URL |
findResource(java.lang.String name)
Finds the resource with the given name.
|
protected java.util.Enumeration<java.net.URL> |
findResources(java.lang.String name)
Returns an Enumeration of all the resources with the given name.
|
Bundle |
getBundle()
Returns the
Bundle object associated with this
BundleReference . |
java.net.URL |
getResource(java.lang.String name)
Finds the resource with the given name.
|
java.io.InputStream |
getResourceAsStream(java.lang.String name)
Finds the resource with the given name and returns the InputStream.
|
java.util.Enumeration<java.net.URL> |
getResourcesOSGi(java.lang.String name)
Finds all the resources with the given name.
|
boolean |
isBootClassContext(java.lang.String name)
Check if the current call is made from a class loaded on the boot class
path (or rather, on a class loaded from something else than a bundle class
loader)
|
protected java.lang.Class<?> |
loadClass(java.lang.String name,
boolean resolve)
Find Class and load it.
|
java.lang.String |
toString()
Return a string representing this object
|
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
protected static org.knopflerfish.framework.BundleClassLoader.SecurityManagerExposer smex
protected java.lang.Class<?> findClass(java.lang.String name) throws java.lang.ClassNotFoundException
findClass
in class java.lang.ClassLoader
java.lang.ClassNotFoundException
ClassLoader.findClass(java.lang.String)
protected java.lang.String findLibrary(java.lang.String name)
findLibrary
in class java.lang.ClassLoader
ClassLoader.findLibrary(java.lang.String)
protected java.util.Enumeration<java.net.URL> findResources(java.lang.String name)
findResources
in class java.lang.ClassLoader
ClassLoader.findResources(java.lang.String)
protected java.net.URL findResource(java.lang.String name)
findResource
in class java.lang.ClassLoader
ClassLoader.findResource(java.lang.String)
public boolean isBootClassContext(java.lang.String name)
name
- The name of the class to load.protected java.lang.Class<?> loadClass(java.lang.String name, boolean resolve) throws java.lang.ClassNotFoundException
loadClass
in class java.lang.ClassLoader
name
- the name of the classresolve
- if true
then resolve the classClass
objectjava.lang.ClassNotFoundException
- if the class could not be foundClassLoader.loadClass(java.lang.String)
public java.net.URL getResource(java.lang.String name)
getResource
in class java.lang.ClassLoader
name
- resource namenull
if the resource could not
be found or the caller doesn't have adequate privileges to get the
resource.ClassLoader.getResource(java.lang.String)
public java.util.Enumeration<java.net.URL> getResourcesOSGi(java.lang.String name) throws java.io.IOException
The name of a resource is a /-separated path name that identifies the resource.
name
- resource nameURL
objects for the
resource. If no resources could be found, the enumeration will be
empty. Resources that the class loader doesn't have access to will
not be in the enumeration.java.io.IOException
ClassLoader.getResources(java.lang.String)
,
Bundle.getResources(String name)
public java.io.InputStream getResourceAsStream(java.lang.String name)
getResourceAsStream
in class java.lang.ClassLoader
name
- resource namenull
if the resource
could not be found or the caller doesn't have adequate privileges
to get the resource.ClassLoader.getResourceAsStream(java.lang.String)
public java.lang.String toString()
toString
in class java.lang.Object
public Bundle getBundle()
BundleReference
Bundle
object associated with this
BundleReference
.getBundle
in interface BundleReference
Bundle
object associated with this
BundleReference
.