|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.osgi.internal.loader.BundleLoader
public class BundleLoader
This object is responsible for all classloader delegation for a bundle. It represents the loaded state of the bundle. BundleLoader objects are created lazily; care should be taken not to force the creation of a BundleLoader unless it is necessary.
BundleLoaderProxy| Field Summary | |
|---|---|
static org.eclipse.osgi.internal.loader.BundleLoader.ClassContext |
CLASS_CONTEXT
|
static java.lang.String |
DEFAULT_PACKAGE
|
static byte |
FLAG_CLOSED
|
static byte |
FLAG_HASDYNAMICEIMPORTALL
|
static byte |
FLAG_HASDYNAMICIMPORTS
|
static byte |
FLAG_IMPORTSINIT
|
static byte |
FLAG_LAZYTRIGGER
|
static java.lang.ClassLoader |
FW_CLASSLOADER
|
static java.lang.String |
JAVA_PACKAGE
|
| Constructor Summary | |
|---|---|
protected |
BundleLoader(BundleHost bundle,
BundleLoaderProxy proxy)
BundleLoader runtime constructor. |
| Method Summary | ||
|---|---|---|
void |
addDynamicImportPackage(ManifestElement[] packages)
Adds a list of DynamicImport-Package manifest elements to the dynamic import tables of this BundleLoader. |
|
void |
attachFragment(BundleFragment fragment)
|
|
static void |
closeBundleLoader(BundleLoaderProxy proxy)
|
|
static
|
compoundEnumerations(java.util.Enumeration<E> list1,
java.util.Enumeration<E> list2)
|
|
BundleClassLoader |
createClassLoader()
|
|
java.lang.Class<?> |
findClass(java.lang.String name)
Finds the class for a bundle. |
|
java.lang.String |
findLibrary(java.lang.String name)
Returns the absolute path name of a native library. |
|
java.net.URL |
findResource(java.lang.String name)
Finds the resource for a bundle. |
|
java.util.Enumeration<java.net.URL> |
findResources(java.lang.String name)
Finds the resources for a bundle. |
|
AbstractBundle |
getBundle()
|
|
KeyedHashSet |
getImportedSources(KeyedHashSet visited)
|
|
BundleLoaderProxy |
getLoaderProxy()
|
|
BundleLoaderProxy |
getLoaderProxy(BundleDescription source)
|
|
static java.lang.String |
getPackageName(java.lang.String name)
Returns the package name from the specified class name. |
|
PackageSource |
getPackageSource(java.lang.String pkgName)
|
|
java.lang.ClassLoader |
getParentClassLoader()
|
|
static java.lang.String |
getResourcePackageName(java.lang.String name)
Returns the package name from the specified resource name. |
|
java.util.Enumeration<java.net.URL> |
getResources(java.lang.String name)
|
|
boolean |
isLazyTriggerSet()
Returns true if the lazy trigger has been set for this delegate. |
|
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 delegate. |
|
java.lang.Class<?> |
loadClass(java.lang.String name)
This method loads a class from the bundle. |
|
void |
setLazyTrigger()
Sets the lazy trigger for this delegate. |
|
java.lang.String |
toString()
Return a string representation of this loader. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_PACKAGE
public static final java.lang.String JAVA_PACKAGE
public static final byte FLAG_IMPORTSINIT
public static final byte FLAG_HASDYNAMICIMPORTS
public static final byte FLAG_HASDYNAMICEIMPORTALL
public static final byte FLAG_CLOSED
public static final byte FLAG_LAZYTRIGGER
public static final org.eclipse.osgi.internal.loader.BundleLoader.ClassContext CLASS_CONTEXT
public static final java.lang.ClassLoader FW_CLASSLOADER
| Constructor Detail |
|---|
protected BundleLoader(BundleHost bundle,
BundleLoaderProxy proxy)
throws BundleException
bundle - Bundle object for this loader.proxy - the BundleLoaderProxy for this loader.
BundleException| Method Detail |
|---|
public static final java.lang.String getPackageName(java.lang.String name)
name - Name of a class.
public static final java.lang.String getResourcePackageName(java.lang.String name)
name - Name of a resource.
public KeyedHashSet getImportedSources(KeyedHashSet visited)
public boolean isLazyTriggerSet()
ClassLoaderDelegate
isLazyTriggerSet in interface ClassLoaderDelegate
public void setLazyTrigger()
throws BundleException
ClassLoaderDelegate
setLazyTrigger in interface ClassLoaderDelegateBundleException - if an error occurred while activating the bundleClassLoaderDelegate.isLazyTriggerSet()public final BundleLoaderProxy getLoaderProxy(BundleDescription source)
public BundleLoaderProxy getLoaderProxy()
public final java.lang.Class<?> loadClass(java.lang.String name)
throws java.lang.ClassNotFoundException
name - the name of the desired Class.
java.lang.ClassNotFoundException - if the class definition was not found.public final java.lang.ClassLoader getParentClassLoader()
public final BundleClassLoader createClassLoader()
public java.lang.Class<?> findClass(java.lang.String name)
throws java.lang.ClassNotFoundException
findClass in interface ClassLoaderDelegatename - the class to find.
java.lang.ClassNotFoundException - if the class is not found.public java.net.URL findResource(java.lang.String name)
findResource in interface ClassLoaderDelegatename - the resource to load.
public java.util.Enumeration<java.net.URL> findResources(java.lang.String name)
throws java.io.IOException
findResources in interface ClassLoaderDelegatename - the resource to find.
java.io.IOException
public java.util.Collection<java.lang.String> listResources(java.lang.String path,
java.lang.String filePattern,
int options)
ClassLoaderDelegateBundleWiring.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.
listResources in interface ClassLoaderDelegatepath - 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)
public java.util.Enumeration<java.net.URL> getResources(java.lang.String name)
throws java.io.IOException
java.io.IOException
public static <E> java.util.Enumeration<E> compoundEnumerations(java.util.Enumeration<E> list1,
java.util.Enumeration<E> list2)
public java.lang.String findLibrary(java.lang.String name)
findLibrary in interface ClassLoaderDelegatename - the library name
public final AbstractBundle getBundle()
public final java.lang.String toString()
toString in class java.lang.Objectpublic final void addDynamicImportPackage(ManifestElement[] packages)
packages - the DynamicImport-Package elements to add.
public void attachFragment(BundleFragment fragment)
throws BundleException
BundleExceptionpublic final PackageSource getPackageSource(java.lang.String pkgName)
public static void closeBundleLoader(BundleLoaderProxy proxy)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||