public class EquinoxBundleClassLoader extends URLClassLoader implements DelegatingBundleReference
Bundle
.
URLClassLoader
and converts resource "bundle"
URLs (found in directories or embedded jar files) into regular jar URLs.
This ClassLoader implementation will only work on Equinox framework.Constructor and Description |
---|
EquinoxBundleClassLoader(org.osgi.framework.Bundle bundle) |
EquinoxBundleClassLoader(org.osgi.framework.Bundle bundle,
boolean searchWiredBundles,
boolean convertResourceUrls) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
Enumeration<URL> |
findResources(String name) |
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.
|
boolean |
getConvertResourceUrls() |
URL |
getResource(String name) |
boolean |
getSearchWiredBundles() |
int |
hashCode() |
protected Class<?> |
loadClass(String name,
boolean resolve) |
void |
setConvertResourceUrls(boolean convert) |
void |
setSearchWiredBundles(boolean search) |
String |
toString() |
addURL, close, definePackage, findClass, findResource, getPermissions, getProtectionDomainInternal, getResourceAsStream, getURLs, newInstance, newInstance
defineClass, defineClass, getProtectionDomain
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public EquinoxBundleClassLoader(org.osgi.framework.Bundle bundle)
public EquinoxBundleClassLoader(org.osgi.framework.Bundle bundle, boolean searchWiredBundles, boolean convertResourceUrls)
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
loadClass
in class ClassLoader
ClassNotFoundException
public URL getResource(String name)
getResource
in class ClassLoader
public Enumeration<URL> findResources(String name) throws IOException
findResources
in class URLClassLoader
IOException
public void setSearchWiredBundles(boolean search)
public boolean getSearchWiredBundles()
public void setConvertResourceUrls(boolean convert)
public boolean getConvertResourceUrls()
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
.getBundle
in interface DelegatingBundleReference
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.BundleReference
Copyright © 2005–2022. All rights reserved.