Weld-osgi is a framework that allows the CDI programming model to be used in the OSGi environment.
The framework was developed entirely by the Weld community and became a part of Weld since version 1.2.0
The framework provides three main features:
-
The CDI programming model can be used within OSGi bundles.
-
The OSGi service layer and utility facilities are accessible through CDI injection
-
The CDI event bus can be used for both inter-bundle communication and delivering OSGi events.
The weld-osgi framework served as an inspiration for a standardization effort, known as RFC-193 (formerly RFP-146).
The proposal is now part of the OSGi early draft
Due to the tight schedule of CDI 1.1, weld-osgi did never make it to Weld 2.0 and was therefore left behind, stuck in the gradually abandoned 1.2 branch.
In the meantime, work on the reference implementation of RFC-193 begun. The reference implementation is known as Pax CDI and it is an open-source project hosted on GitHub.
Pax CDI aims to be portable across OSGi implementations as well as CDI implementations.
We always wanted to bring OSGi support back in Weld 2.1. However, we decided not to revive the weld-osgi framework nor align it to the new RFC-193 specification. Therefore, weld-osgi will not be merged into Weld 2.x code base.
Instead, we decided to shift our focus towards Pax CDI and make sure it works well with Weld.
This was done and Weld 2.1.0 is now one of the CDI runtimes supported by Pax CDI. You can play with the current Pax CDI SNAPSHOT
or wait for the upcoming 0.5 release.