public interface ClassLoaderDelegate
This interface is not intended to be implemented by clients.
Modifier and Type | Method and Description |
---|---|
Class<?> |
findClass(String classname)
Finds a class for a bundle that may be outside of the actual bundle
(i.e.
|
String |
findLibrary(String libraryname)
Returns the absolute path name of a native library.
|
URL |
findResource(String resource)
Finds a resource for a bundle that may be outside of the actual bundle
(i.e.
|
Enumeration<URL> |
findResources(String resource)
Finds an enumeration of resources for a bundle that may be outside of
the actual bundle (i.e.
|
boolean |
isLazyTriggerSet()
Returns true if the lazy trigger has been set for this
delegate.
|
Collection<String> |
listResources(String path,
String filePattern,
int options)
Returns the names of resources visible to this delegate.
|
void |
setLazyTrigger()
Sets the lazy trigger for this delegate.
|
Class<?> findClass(String classname) throws ClassNotFoundException
If the class does not belong to an imported package or is not found in a required bundle then the ClassloaderDelegate will call BundleClassLoader.findLocalClass().
If no class is found then a ClassNotFoundException is thrown.
classname
- the class to find.ClassNotFoundException
- if the class is not found.URL findResource(String resource)
If the resource does not belong to an imported package or is not found in a required bundle then the ClassloaderDelegate will call BundleClassLoader.findLocalResource().
If no resource is found then return null.
resource
- the resource to load.Enumeration<URL> findResources(String resource) throws IOException
If the resource does not belong to an imported package or is not found in a required bundle then the ClassloaderDelegate will call BundleClassLoader.findLocalResource().
If no resource is found then return null.
resource
- the resource to find.IOException
String findLibrary(String libraryname)
libraryname
- the library to find the path to.boolean isLazyTriggerSet()
void setLazyTrigger() throws BundleException
BundleException
- if an error occurred while activating the bundleisLazyTriggerSet()
Collection<String> listResources(String path, String filePattern, int options)
BundleWiring.listResources(String, String, int)
method.
First a search is done on the packages imported by the bundle associated
with this delegate. Next a search is done on the the bundles required by
the bundle associated with this delegate. Finally a local search of
the bundle associated with this delegate is done by calling
BundleClassLoader.listLocalResources(String, String, int)
. Note
that for imported packages the search stops at the source for the import.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)
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.