OSGi injection in GlassFish - Now with type safety!
By alexismp on Nov 24, 2010
While GlassFish 3 and above is built on top of OSGi (Felix by default), it is abstracted away by the HK2 layer and certainly not exposed to developers by default. But if they want to leverage the OSGi capabilities of the runtime, they certainly can.
In addition to everything that was already discussed on how OSGi can be leverage from GlassFish, Siva now introduces in his blog how a GlassFish 3.1 CDI Portable Extension (part of the default distro) offers a type-safe
@Inject'ion of OSGi dynamic services without having to manually look-up or bind to it. The
@OSGiService CDI qualifier offered here supports a number of attributes for dynamic binding, OSGi discovery criteria, and binding timeout.
Update: you can now look at the corresponding screencast on YouTube.