logo
OSGi Framework - Interview Questions and Answers
What are OSGi R6 and R7 features?
OSGi R6 vs. OSGi R7: Features and Enhancements

The OSGi (Open Services Gateway initiative) specifications are continuously evolving. OSGi R6 (Release 6) and OSGi R7 (Release 7) introduced significant improvements in modularity, dependency injection, and runtime capabilities.


1. OSGi R6 Features (2015)

OSGi R6 focused on improving dependency injection, security, and RESTful APIs.

Key Features of OSGi R6 :
* Declarative Services (DS) 1.3 Enhancements
  • Support for constructor-based injection.
  • @Reference annotations can now inject multiple services as a list.
  • Improved handling of configuration properties using @ObjectClassDefinition.
* OSGi Config Admin Enhancements
  • Introduction of typed configurations using @ObjectClassDefinition.
  • Easier configuration metadata generation.
* OSGi REST Management API
  • Standardized remote management of OSGi frameworks using REST APIs.
* Security Improvements
  • Enhanced Java Security Manager integration for fine-grained control over permissions.
* HTTP Whiteboard 1.0
  • Introduced a simplified way to register servlets, filters, and listeners dynamically using annotations.

2. OSGi R7 Features (2018)

OSGi R7 focused on enhanced modularity, Java 9+ support, and improved annotations.


Key Features of OSGi R7 :
* Java 9+ Support
  • Full compatibility with Java Modules (module-info.java).
  • Improved JPMS (Java Platform Module System) integration.
* Declarative Services (DS) 1.4 Enhancements
  • @Component now supports default methods in interfaces.
  • Improved service scope management (PROTOTYPE, BUNDLE, etc.).
  • New Factory Components for dynamic instance creation.
* OSGi Push Streams
  • Introduction of reactive programming support for event-driven architectures.
  • Efficient handling of asynchronous data streams in OSGi.
* Config Admin 1.6 Enhancements
  • Configuration snapshots for better rollback support.
  • New APIs for tracking configuration updates.
* JAX-RS Whiteboard
  • Enhanced support for RESTful Web Services (JAX-RS 2.1) in OSGi.
  • Allows dynamic registration of JAX-RS resources and providers.
* HTTP Whiteboard 1.1 Enhancements
  • Support for WebSockets in OSGi.
  • Better support for servlets and filters with dynamic runtime updates.
* Log Service 1.4 Enhancements
  • Improved logging API for structured logs.
  • Standardization of log levels and filtering.
* New OSGi Features
  • Coordinators API for transaction-style coordination.
  • Improved metatype specifications for defining configurations.

Comparison: OSGi R6 vs. R7
Feature OSGi R6 (2015) OSGi R7 (2018)
Java Compatibility Java 8 Java 9+ (JPMS support)
Declarative Services DS 1.3 (Better Injection) DS 1.4 (Factory Components, Default Methods)
Config Admin Typed Configurations (@ObjectClassDefinition) Config Snapshots, Tracking Updates
Modularity Improved but limited Full JPMS (Java 9 Modules) support
Web & HTTP HTTP Whiteboard 1.0 WebSockets, JAX-RS Whiteboard
Asynchronous Handling Basic event handling Push Streams API (Reactive Streams)
Security Java Security Manager Improvements Enhanced Permissions & Transactions