OSGi (Open Services Gateway Initiative) is a dynamic module system for java. It defines a component and service model where the components and services can be dynamically (de-)activated, updated and so on.
OSGi and Dependancy Injection
OSGi does dependancy management between bundles. When a bundle is activated it loads all dependant bundles.
Bundle Status
RESOLVED | All required dependancies in the bundle are resolved |
INSTALLED | not resolved |
STARTING | bundle is started |
ACTIVE | bundle is active |
Extension Points
Eclipse Equinox extends the concept of bundles with the concept of extension points.
Eclipse OSGi Console
To access the Eclipse OSGi console:
In the console view window click on the small down arrow next to the 'Open Console' icon and click on 'Host OSGi console'
osgi> status "Framework is launched." id "Bundle Location" "State Bundle File Name" 0 System Bundle ACTIVE org.eclipse.osgi_3.10.0.v20140606-1445 [0] 1 initial@reference:file:plugins/org.eclipse.osgi.compatibility.state_1.0.0.v20140403-1907.jar RESOLVED org.eclipse.osgi.compatibility.state_1.0.0.v20140403-1907 [1] <snip> 37 reference:file:plugins/org.eclipse.ant.core_3.3.0.v20140518-0042.jar STARTING org.eclipse.ant.core_3.3.0.v20140518-0042 [37] <snip> 209 reference:file:plugins/org.eclipse.jdt.annotation_2.0.0.v20140415-1436.jar INSTALLED org.eclipse.jdt.annotation_2.0.0.v20140415-1436 [209] <snip> "Registered Services" {org.eclipse.osgi.framework.log.FrameworkLog}={service.ranking=2147483647, service.pid=0.org.eclipse.osgi.internal.log.EquinoxLogFactory, service.vendor=Eclipse.org - Equinox, service.id=3, service.bundleid=0, service.scope=bundle} {org.eclipse.osgi.service.datalocation.Location}={service.ranking=2147483647, type=osgi.user.area, service.pid=0.org.eclipse.osgi.internal.location.BasicLocation, service.vendor=Eclipse.org - Equinox, service.id=5, service.bundleid=0, service.scope=singleton} <snip> |