Posts

Showing posts with the label OSGi

When to use Import-Package and Require-Bundle in Eclipse Plugin?

The OSGi way is to use Import-Package, as it specifically decouples the package from the bundle that provides it. Require-Bundle: Bundles can be re-exported Gives you access to all exports of the bundle, regardless of what they are, and regardless of whether you need them. Specifies the explicit bundle (and version) to use. If a required bundle needs to be refactored and a package moved elsewhere, then dependents will need changes to their MANIFEST.MF file. Import-Package: Loose coupling, only the package (and version) is specified and the run-time finds the required bundle. Actual implementations can be swapped out Dependent packages can be moved to different bundles by the package owner But requires more metadata to be maintained (i.e: each package name) at lower levels of granularity In my view we should below approach in using Import Package or Require-Bundle Interface <=> Import-Package Implementation class <=> ...

OSGI and Eclipse Version

2004 Eclipse 3.0 -> OSGi 4.0 early draft 2005 Eclipse 3.1 -> OSGi 4.0 draft 2006 Eclipse 3.2 Callisto -> OSGi 4.0 2007 Eclipse 3.3 Europa -> OSGi 4.1 2008 Eclipse 3.4 Ganymede -> OSGi 4.1 2009 Eclipse 3.5 Galileo -> OSGi 4.2 2010 Eclipse 3.6 Helios -> OSGi 4.2 2011 Eclipse 4.1/3.7 Indigo -> OSGi 4.3 2012 Eclipse 4.2/3.8 Juno -> OSGi 5 2013 Eclipse 4.3/3.9 Kepler -> OSGi 5     The Bundle-ManifestVersion is not mandatory. If it is missing then defaults version 1. OSGi R4 introduced Bundle-ManifestVersion: 2 , and so in practice,  almost all bundles have this entry.