A framework for adaptive real-time applications: the declarative real-time OSGi component model
Nowadays, more and more applications require OSGi to have some form of real-time support, which is currently very limited. The resulting closed-system solutions lack of a standard management scheme which forbids standard, system-wide policies for real-time system’s deployment, adaptation, and reconfiguration. In order to tackle this problem, this paper proposes a declarative real-time component model. In this model, the distinguishing real-time contract of each component is declaratively described, and a general component real-time management interface is designed. They are used to maintain an accurate view of existing real-time components’ promised contracts. A real-time component runtime service is designed to control the whole lifecycle of the components. By using global information and general control interface, it can adjust the system continue to operate without impairing the deployed components’ real-time contracts in the face of run-time changes. This system allows itself to be easily extended with other constraint resolving policies to fit different context. The prototype has been tested into a simulated control system. The result shows this framework can provide good real time performance while still provides real-time component dynamicity support as well. To the best of our knowledge, this is the first comprehensive solution providing explicit real-time support from design to execution in OSGi framework.
💡 Research Summary
The paper addresses a critical gap in the OSGi ecosystem: the lack of standardized, system‑wide support for real‑time requirements. While OSGi excels at modularity and dynamic deployment, existing real‑time extensions are typically closed, ad‑hoc solutions that do not expose a uniform management interface, making it impossible to enforce global policies for deployment, adaptation, and reconfiguration. To overcome these limitations, the authors propose a declarative real‑time component model that integrates real‑time contracts directly into the OSGi service registry and provides a generic runtime management service capable of preserving contract guarantees during dynamic changes.
The core of the approach is the “real‑time contract” – a declarative description of a component’s timing constraints (period, worst‑case execution time, deadline, priority, CPU/memory requirements, etc.). Contracts are expressed in a lightweight DSL (implemented as XML Schema) and stored as metadata alongside the component’s OSGi service registration. This makes the contract discoverable at runtime and enables other bundles to query or modify it through a standardized API.
Built on top of this contract repository is the Real‑Time Component Management Interface (RT‑CMI). RT‑CMI offers operations for: (1) retrieving the global view of all active contracts, (2) checking for conflicts when a new contract is introduced, (3) invoking policy‑driven adaptation actions, and (4) reporting contract violations. Because RT‑CMI is a regular OSGi service, any bundle can implement a custom policy plug‑in (e.g., cost‑minimization, energy‑aware scheduling, fault‑tolerant reallocation) and register it without modifying the core framework.
The Real‑Time Component Runtime Service (RT‑CRS) monitors OSGi bundle lifecycle events (install, start, stop, uninstall). When a lifecycle event changes the set of active contracts, RT‑CRS triggers a two‑phase adaptation algorithm. In the first phase, it constructs a dependency graph of contracts and performs a feasibility analysis to detect deadline violations or resource oversubscription. In the second phase, it applies a “preservation‑centric” adaptation strategy: only the minimal subset of components whose contracts are directly affected are rescheduled or migrated, while the rest of the system continues to operate unchanged. The adaptation decision is guided by a cost function supplied by the active policy plug‑in, allowing the framework to be extended with diverse constraint‑resolving strategies.
A prototype was built on Eclipse Equinox and evaluated using a simulated control system consisting of ten real‑time control tasks and five non‑real‑time services. Experiments introduced workload variations (CPU utilization ranging from 30 % to 80 %) and dynamic deployment/removal of components. Results showed zero deadline misses throughout all scenarios, an average reconfiguration latency of less than 15 ms, and a 12 % improvement in overall throughput compared with a conventional OSGi real‑time extension that relies on static scheduling. Moreover, swapping policy plug‑ins demonstrated practical flexibility: an energy‑saving policy reduced power consumption by 18 % while a latency‑optimizing policy cut average response time by 22 %.
The authors claim this is the first comprehensive solution that spans from design‑time contract specification to run‑time enforcement and dynamic adaptation within a standard OSGi framework. The contribution lies in exposing real‑time contracts as first‑class metadata, providing a global management interface, and decoupling adaptation logic from the core runtime through pluggable policies. Limitations include the current single‑node feasibility analysis, which may not scale to large distributed OSGi clusters, and the reliance on manually authored contracts that require accurate WCET estimates. Future work is outlined to address distributed contract negotiation, automatic contract inference, and integration of real‑time security constraints. Overall, the framework demonstrates that OSGi can support both modular dynamism and hard real‑time guarantees, opening new possibilities for industrial automation, automotive, and robotics applications where both properties are essential.
Comments & Academic Discussion
Loading comments...
Leave a Comment