OSGi Bundle Segmentation for Resource Reclamation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The OSGi framework lacks infrastructure to enforce resource cleanup and stopping of bundles, leading to potential inconsistencies and the need for full restarts, especially in 24/7 environments, due to the absence of facilities to manage resources of bundles in the RESOLVED state.
Innovation Solution
Introducing two types of bundles: code sharing bundles that only share classes and resources without activating or owning threads, and application bundles that provide active computing capabilities, with separate lifecycle rules to ensure resource reclamation and consistency, including repeated initialization of static fields for each client bundle.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If bundles share code through package export in OSGi, then code reusability and memory efficiency are improved, but resource cleanup and consistency are worsened when bundles are stopped
Solution Approach 1:
The patent segments bundles into two distinct types: code sharing bundles (CDBs) that only export packages without activation, and application bundles that provide active services. This segmentation allows CDBs to be stopped and restarted without affecting running applications, while application bundles maintain proper lifecycle management. The separation resolves the contradiction by allowing code sharing without the resource cleanup issues that arise when stopping traditional active bundles.
Solution Approach 2:
The patent extracts the code sharing functionality from the bundle activation model. Code sharing bundles export packages and make them available to other bundles without being activated or owning threads. This extraction separates the code sharing function from the active execution function, allowing code to be shared without the complications of resource cleanup that occur when stopping active bundles.
2Ease of operation
If traditional bundle lifecycle management is used, then active applications can be stopped and restarted, but resource cleanup cannot be enforced and full restart is required
Solution Approach 1:
By segmenting bundles into code sharing bundles and application bundles, the patent enables selective stopping. Code sharing bundles can be stopped and restarted without affecting running applications, and their resources can be properly reclaimed. This segmentation allows the system to stop and restart code sharing bundles freely while maintaining resource consistency, eliminating the need for full framework restarts.
Solution Approach 2:
The patent introduces an intermediary mechanism where the OSGi framework maintains control over package exports even when code sharing bundles are stopped. The framework acts as an intermediary that ensures package consistency and manages resource reclamation, allowing bundles to be stopped without causing inconsistency in exported packages.
3Reliability
If bundles initialize static fields during activation, then code functionality is complete, but repeated initialization is required for each client bundle
Solution Approach 1:
The patent segments the bundle functionality so that code sharing bundles only export packages without activating or initializing static fields. Application bundles that need static field initialization are kept separate and are not stopped when code sharing bundles are restarted. This segmentation eliminates repeated initialization overhead while maintaining complete code functionality in application bundles.
Data Source
AI summary
A system and method for categorizing bundles into two categories in an OSGi framework. The first type of bundle is referred to as a code sharing bundle, while the second type of bundle is referred to as an application bundle. Code sharing bundles are primarily static in nature and act as libraries, while application bundles are dynamic and contain active applications. This arrangement reduces dependencies between bundles, as well as providing a number of additional benefits.


