public class DefaultBundleAccessor extends Object implements BundleAccessor
CURRENT_BUNDLE_NAME| Constructor and Description |
|---|
DefaultBundleAccessor()
This is a "defective" Singleton, possibly due to framework initialization requirements.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPackageFromBundle(org.osgi.framework.Bundle bundle,
String packageName)
Add as Bundle -> Package mapping
|
org.osgi.framework.ServiceReference[] |
getAllServiceReferences(String className) |
static DefaultBundleAccessor |
getInstance() |
Set<String> |
getPackagesByBundle(org.osgi.framework.Bundle bundle) |
Object |
getService(org.osgi.framework.ServiceReference ref) |
org.osgi.framework.ServiceReference |
getServiceReference(String className) |
org.osgi.framework.ServiceReference[] |
getServiceReferences(String className,
String params) |
Class<?> |
loadClass(String className) |
URL |
loadResource(String name) |
URL |
loadResource(String name,
boolean translate) |
InputStream |
loadResourceAsStream(String name) |
URL |
loadResourceFromAllBundles(String name) |
InputStream |
loadResourceFromAllBundlesAsStream(String name) |
List<URL> |
loadResources(String name) |
List<URL> |
loadResources(String name,
boolean translate) |
void |
setBundleContext(org.osgi.framework.BundleContext bundleContext) |
void |
setOsgiHost(OsgiHost osgiHost) |
public DefaultBundleAccessor()
instead.public static DefaultBundleAccessor getInstance()
public Object getService(org.osgi.framework.ServiceReference ref)
getService in interface BundleAccessorpublic org.osgi.framework.ServiceReference getServiceReference(String className)
getServiceReference in interface BundleAccessorpublic org.osgi.framework.ServiceReference[] getAllServiceReferences(String className)
getAllServiceReferences in interface BundleAccessorpublic org.osgi.framework.ServiceReference[] getServiceReferences(String className, String params) throws org.osgi.framework.InvalidSyntaxException
getServiceReferences in interface BundleAccessororg.osgi.framework.InvalidSyntaxExceptionpublic void addPackageFromBundle(org.osgi.framework.Bundle bundle,
String packageName)
addPackageFromBundle in interface BundleAccessorbundle - the bundle where the package was loaded frompackageName - the name of the loaded packagepublic Class<?> loadClass(String className) throws ClassNotFoundException
loadClass in interface BundleAccessorClassNotFoundExceptionpublic List<URL> loadResources(String name) throws IOException
IOExceptionpublic List<URL> loadResources(String name, boolean translate) throws IOException
IOExceptionpublic URL loadResourceFromAllBundles(String name) throws IOException
loadResourceFromAllBundles in interface BundleAccessorIOExceptionpublic InputStream loadResourceFromAllBundlesAsStream(String name) throws IOException
loadResourceFromAllBundlesAsStream in interface BundleAccessorIOExceptionpublic Set<String> getPackagesByBundle(org.osgi.framework.Bundle bundle)
getPackagesByBundle in interface BundleAccessorpublic InputStream loadResourceAsStream(String name) throws IOException
loadResourceAsStream in interface BundleAccessorIOExceptionpublic void setBundleContext(org.osgi.framework.BundleContext bundleContext)
setBundleContext in interface BundleAccessorpublic void setOsgiHost(OsgiHost osgiHost)
setOsgiHost in interface BundleAccessorCopyright © 2000–2023 Apache Software Foundation. All rights reserved.