OSGi overview

OSGi is a module system that is compatible with systems that are based on Java™ and implements a dynamic component model. Enterprise systems can use OSGi to improve the maintainability of runtime infrastructures. Applications, in the form of bundles, can be remotely installed, started, stopped, updated, and uninstalled without requiring a restart.

OSGi features

OSGi tools include the following major features:

Container for OSGi Blueprint components
The OSGi application framework includes the Apache Software Foundation's Aries open implementation of the OSGi Version 4.2 Blueprint component model that defines a standard dependency injection mechanism for Java components. The implementation is derived from the Spring Framework and extended for OSGi to declaratively register component interfaces as services in the OSGi service registry.
Model for assembling bundles
The OSGi tools include a model for assembling an application into a deployable unit. The unit can consist of multiple bundles and includes the metadata that describes the version and external location of the constituent bundles of the application.
Runtime components
The OSGi tools support the development of OSGi applications that run in an OSGi framework, exploiting enterprise Java technologies common in web applications and integration scenarios that include web application bundles, remote services integration, and JPA.
Extensions
The OSGi tools include extensions that go beyond the OSGi Enterprise Expert Group specifications to provide a complete integration of OSGi modularity with Java enterprise technologies. In particular it delivers support that includes but is not restricted to the following features:
  • Isolated enterprise applications that are composed of multiple, versioned bundles with dynamic lifecycle.
  • Declarative transactions and security for Blueprint components.
  • Container-managed JPA for Blueprint components.
  • Message-driven Blueprint components.
  • Configuration of resource references in module Blueprint Services.
  • Annotation-based Blueprint configuration.
  • Federation of lookup mechanisms between local JNDI and the OSGi service registry.

Benefits of OSGi

OSGi modularity provides standard mechanisms to address the issues faced by Java EE applications. The OSGi framework provides the following benefits:
  • Applications are portable, easier to re-engineer, and adaptable to changing requirements.
  • The framework provides the declarative assembly and simplified unit test of the Spring Framework, but in a standardized form that is provided as part of the application server runtime rather than being a third-party library deployed as part of the application.
  • The framework integrates with the Java EE programming model, giving you the option of deploying a web application as a set of versioned OSGi bundles with dynamic lifecycle.
  • It supports administration of application bundle dependencies and versions, simplifying and standardizing third-party library integration.
  • The framework provides isolation for enterprise applications that are composed of multiple, versioned bundles with dynamic lifecycles.
  • It has a built-in bundle repository that can host common and versioned bundles that are shared between multiple applications so that each application does not deploy its own copy of each common library.
  • OSGi applications can access external bundle repositories.
  • The framework reinforces service-oriented design at the module level.