Thursday, March 29, 2012

Gemini Web feat. Gemini Naming or Injecting OSGi Services the Java EE Way

A presentation by Violeta Georgieva of SAP on the Gemini project on which she works.
  • Gemini is a web container
  • Develops with Libra installed that provides WTP and PDE working together. MANIFEST.MF in PDE manifest editor but right-click project > add servlet.
  • New dynamic web project, add osgi bundle in config
  • Run under Gemini web, can install other WARs or WABs (Web Archive Bundle)
  • Right-click > Run as > OSGi framework
  • A WAR/WAB can use OSGi services exposed in another WAB.
    • ServiceTracker in servlet to obtain an OSGi serviceJNDI
    • jndi with osgi-based url
      • e.g., new InitialContext.lookup("java.something")
      • Meta-inf/context.xml entry
  • Can use Dependency Injection (DI) using J2EE 6 annotations:
    • @Resource("name=LogService")
A pretty cool demo. How long do we have before we should deploy OSGi on the server? It's nice to know there's tooling available now and that OSGi service use is covered.

No comments:

Post a Comment