public class BundleClassLoader extends java.lang.ClassLoader implements org.osgi.framework.BundleReference
Bundle.
Bundle.getResource(String) or
Bundle.getResources(String) does not return the resources found in the wired bundles of the bundle
(wired via Import-Package or DynamicImport-Package). This class loader implementation provides
#getResource(String) and {@link #getResources(String)} methods that do delegate such resource lookups to
the wired bundles.| Constructor and Description |
|---|
BundleClassLoader(org.osgi.framework.Bundle bundle) |
BundleClassLoader(org.osgi.framework.Bundle bundle,
boolean searchWiredBundles) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object other) |
org.osgi.framework.Bundle |
getBundle()
Return the bundle associated with this classloader.
|
org.osgi.framework.Bundle |
getBundle(boolean unwrap)
Return the bundle associated with this classloader.
|
java.net.URL |
getResource(java.lang.String name) |
java.util.Enumeration<java.net.URL> |
getResources(java.lang.String name) |
boolean |
getSearchWiredBundles() |
int |
hashCode() |
java.lang.Class<?> |
loadClass(java.lang.String name) |
protected java.lang.Class<?> |
loadClass(java.lang.String name,
boolean resolve) |
void |
setSearchWiredBundles(boolean search) |
java.lang.String |
toString() |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResourceAsStream, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignerspublic BundleClassLoader(org.osgi.framework.Bundle bundle)
public BundleClassLoader(org.osgi.framework.Bundle bundle, boolean searchWiredBundles)
public java.lang.Class<?> loadClass(java.lang.String name) throws java.lang.ClassNotFoundException
loadClass in class java.lang.ClassLoaderjava.lang.ClassNotFoundExceptionprotected java.lang.Class<?> loadClass(java.lang.String name, boolean resolve) throws java.lang.ClassNotFoundException
loadClass in class java.lang.ClassLoaderjava.lang.ClassNotFoundExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.net.URL getResource(java.lang.String name)
getResource in class java.lang.ClassLoaderpublic java.util.Enumeration<java.net.URL> getResources(java.lang.String name) throws java.io.IOException
getResources in class java.lang.ClassLoaderjava.io.IOExceptionpublic void setSearchWiredBundles(boolean search)
public boolean getSearchWiredBundles()
public org.osgi.framework.Bundle getBundle(boolean unwrap)
DelegatingBundle.
In such cases, the unwrap parameter controls whether this function returns the
DelegatingBundle instance or the main application bundle backing with the DelegatingBundle.unwrap - If true and if the bundle associated with this classloader is a DelegatingBundle,
this function will return the main application bundle backing with the DelegatingBundle.
Otherwise, the bundle associated with this classloader is returned as is.public org.osgi.framework.Bundle getBundle()
getBundle(true) and therefore always returns a regular
framework bundle.
BundleReference.getBundle() to obtain a bundle for the given
classloader and expect the returned bundle instance to be work with any OSGi API. Some of these API might
not work if DelegatingBundle is returned. That is why this function will always return
a regular framework bundle. See getBundle(boolean) for more information.getBundle in interface org.osgi.framework.BundleReferencepublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in class java.lang.ObjectCopyright © 2005-2012. All Rights Reserved.