OSGi – Accessing Bundle/Service information from BundleContext

Here are few code snippets compiled in a java program, which would help you fetch bundle and service information from BundleContext. The snippets cover: Fetching bundle information Fetching ServiceReference from bundle Fetching Service from bundleContext More API details can be retrived from: https://osgi.org/javadoc/r4v43/core/org/osgi/framework/Bundle.html https://osgi.org/javadoc/r4v43/core/org/osgi/framework/ServiceReference.html    

Advertisements