Part 1 – OSGi: What, Why & How

What is OSGi?
OSGi is a Java-based service platform that can be remotely managed. OSGi has been developed by the OSGi Alliance (formerly known as the Open Services Gateway initiative) is an open standards organization founded in March 1999. The OSGi framework defines an application life cycle management model, a service registry, an Execution environment and Modules.

Read More:
Download the specification:

OSGi Architecture (Source: Wikipedia)


  • Bundles
    Bundles are normal jar components with extra manifest headers. The bundles are loosely coupled & highly cohesive.
  • Services
    The services layer connects bundles in a dynamic way by offering a publish-find-bind model for plain old Java objects (POJO).
  • Services Registry
    The API for management services.
  • Life-Cycle
    The API for life cycle management (install, start, stop, update, and uninstall bundles).
  • Modules
    The layer that defines encapsulation and declaration of dependencies (how a bundle can import and export code).
  • Security
    The layer that handles the security aspects by limit bundle functionality to pre-defined capabilities.
  • Execution Environment
    Defines what methods and classes are available in a specific platform.

Why should we use OSGi?
OSGi offers extreme modularity for the developer as the developers will be developing the modules as Bundles which can be plugged in to the application anytime from anywhere. This also enables the reusability and maintainability of the modules. We can even remove some of the modules for upgrade/bug fixes with out disturbing other modules.

Read more:

How can we develop OSGi based applications?
We can develop an OSGi based application using any of the OSGi implementations. Three of the most widely used implementations are, Equinox (Eclipse Foundation), Apache Felix & Knopflerfish.