Overview of OSGi Support in GlassFish v3


This is a short overview of how GlassFish v3 provides support for OSGi through pointers to the work / posts of Richard, Sahoo, Jerome and many others.

The story starts with an OSGi-core that is used in a system that is organized around the notions of a kernel, services and components. A good overview is Jerome's presentation at JavaOne, TS-4923.

For the basic deployment check Jerome's GFv3 Extensions: Managed OSGi bundles which explains how asadmin deploy --type=osgi myosgibundle.jar will deploy an OSGi bundle: GFv3 installs the bundle in the OSGi framework, starts it and also records the information in domain.xml, so asadmin list-components will show that an OSGi bundle has been deployed. Note you can then Use the Felix Web Console to browse through the OSGi bundles.

There are other ways to activate the same deployment machinery and, in Using filesystem operations to manage OSGi bundles in GlassFish, Sahoo shows how GFv3 leverages Apache Felix's FileInstall to allow autodeploy via the autodeploy-bundles/ directory.

Jerome's next two posts describe an extension in GF v3 that allows applications to use @Resource to refer to OSGi services. In the first one, GF v3 Extensions: Spring, Java EE 6 and OSGi, the service is a Spring Bean that is exposed to the OSGi service registry using Spring DM, while in GF v3 Extensions: OSGi Declarative Services he just uses the standard OSGi Declarative Services, which were made part of the standard GF v3 bundle starting with b55

More posts in a future installment...


Post a Comment:
Comments are closed for this entry.