|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BundleClassLoader
The BundleClassLoader interface is used by the Framework to load local classes and resources from a Bundle. Classes that implement this interface must extend java.lang.ClassLoader, either directly or by extending a subclass of java.lang.ClassLoader.
ClassLoaders that implement the BundleClassLoader
interface
must use a ClassLoaderDelegate
to delegate all class, resource
and native library lookups.
Clients may implement this interface.
BundleData.createClassLoader(ClassLoaderDelegate, BundleProtectionDomain, String[])
Method Summary | |
---|---|
void |
attachFragment(BundleData bundledata,
java.security.ProtectionDomain domain,
java.lang.String[] classpath)
Attaches the BundleData for a fragment to this BundleClassLoader. |
void |
close()
Closes this class loader. |
java.lang.Class |
findLocalClass(java.lang.String classname)
Finds a local class in the BundleClassLoader without consulting the delegate. |
java.net.URL |
findLocalResource(java.lang.String resource)
Finds a local resource in the BundleClassLoader without consulting the delegate. |
java.util.Enumeration |
findLocalResources(java.lang.String resource)
Finds all local resources in the BundleClassLoader with the specified path without consulting the delegate. |
ClassLoaderDelegate |
getDelegate()
Returns the ClassLoaderDelegate used by this BundleClassLoader |
java.lang.ClassLoader |
getParent()
Returns the parent classloader used by this BundleClassLoader |
java.net.URL |
getResource(java.lang.String name)
This method will first search the parent class loader for the resource; That failing, this method will invoke ClassLoaderDelegate.findResource(String) to find the resource. |
java.util.Enumeration |
getResources(java.lang.String name)
This method will first search the parent class loader for the resource; That failing, this method will invoke ClassLoaderDelegate.findResource(String) to find the resource. |
void |
initialize()
Initializes the ClassLoader. |
java.lang.Class |
loadClass(java.lang.String name)
This method will first search the parent class loader for the class; That failing, this method will invoke ClassLoaderDelegate.findClass(String) to find the resource. |
Method Detail |
---|
void initialize()
java.net.URL findLocalResource(java.lang.String resource)
resource
- the resource path to find.
java.util.Enumeration findLocalResources(java.lang.String resource)
resource
- the resource path to find.
java.lang.Class findLocalClass(java.lang.String classname) throws java.lang.ClassNotFoundException
classname
- the classname to find.
java.lang.ClassNotFoundException
- if the classname does not exist locally.java.net.URL getResource(java.lang.String name)
ClassLoaderDelegate.findResource(String)
to find the resource.
name
- the resource path to get.
null
if the resource is not found.java.util.Enumeration getResources(java.lang.String name) throws java.io.IOException
ClassLoaderDelegate.findResource(String)
to find the resource.
name
- the resource path to get.
null
if the resource is not found.
java.io.IOException
java.lang.Class loadClass(java.lang.String name) throws java.lang.ClassNotFoundException
ClassLoaderDelegate.findClass(String)
to find the resource.
name
- the class name to load.
java.lang.ClassNotFoundException
void close()
void attachFragment(BundleData bundledata, java.security.ProtectionDomain domain, java.lang.String[] classpath)
bundledata
- The BundleData of the fragment.domain
- The ProtectionDomain of the resources of the fragment.
Any classes loaded from the fragment's BundleData must belong to this
ProtectionDomain.classpath
- An array of Bundle-ClassPath entries to
use for loading classes and resources. This is specified by the
Bundle-ClassPath manifest entry of the fragment.ClassLoaderDelegate getDelegate()
java.lang.ClassLoader getParent()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |