|
||||||||||
| 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.util.List<java.net.URL> |
findEntries(java.lang.String path,
java.lang.String filePattern,
int options)
Returns resource entries for the bundle associated with 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<java.net.URL> |
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<java.net.URL> |
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.util.Collection<java.lang.String> |
listLocalResources(java.lang.String path,
java.lang.String filePattern,
int options)
Returns the names of local resources visible to this bundle class loader. |
java.util.Collection<java.lang.String> |
listResources(java.lang.String path,
java.lang.String filePattern,
int options)
Returns the names of resources visible to this bundle class loader. |
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. |
| Methods inherited from interface org.osgi.framework.BundleReference |
|---|
getBundle |
| Method Detail |
|---|
void initialize()
java.net.URL findLocalResource(java.lang.String resource)
resource - the resource path to find.
java.util.Enumeration<java.net.URL> 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<java.net.URL> 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.ClassNotFoundExceptionvoid 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()
java.util.List<java.net.URL> findEntries(java.lang.String path,
java.lang.String filePattern,
int options)
BundleWiring.findEntries(String, String, int) method.
path - The path name in which to look.filePattern - The file name pattern for selecting resource names in
the specified path.options - The options for listing resource names.
BundleWiring#findEntries(String, String, int)}
java.util.Collection<java.lang.String> listResources(java.lang.String path,
java.lang.String filePattern,
int options)
BundleWiring.listResources(String, String, int) method.
This method should simply return the result of calling
ClassLoaderDelegate.listResources(String, String, int)
path - The path name in which to look.filePattern - The file name pattern for selecting resource names in
the specified path.options - The options for listing resource names.
BundleWiring#listResources(String, String, int)},
ClassLoaderDelegate#listResources(String, String, int)}
java.util.Collection<java.lang.String> listLocalResources(java.lang.String path,
java.lang.String filePattern,
int options)
path - The path name in which to look.filePattern - The file name pattern for selecting resource names in
the specified path.options - The options for listing resource names.
ClassLoaderDelegate#listResources(String, String, int)}
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||