OSGi Equinox in a Servlet Container [step0]
I love OSGi, if you don’t know OSGi and OSGi benefits, you could read articles Conception d’un client Eclipse RCP et serveur OSGI avec Spring DM where I have tried to explain how OSGi works and what are OSGi benefits.
In short, OSGi give the capability to split your application in different modules (called OSGi bundles) that you can start/stop (with OSGi console). OSGi bundles use an OSGi services registry to publish/retrieve OSGi services.
Each OSGi bundles are managed with an OSGi container (like WEB application are managed with HTTP serveur container). Equinox is an implementation of OSGi container that is used with Eclipse to manage Plug-in (which are OSGI bundles).
OSGi can be used in the WEB application. Server-Side Equinox provides the capability to manage OSGi bundles in WEB Application with 2 means :
- Embedding an HTTP server in OSGi container : it means that HTTP server and WEB application are OSGi bundles. The OSGi container start the HTTP server bundle. Embedding an HTTP server in Equinox explains how this mean is done with Equinox.
You can resume « embedding an HTTP server in OSGi container » like this :
OSGi container -> HTTP Server (bundle) -> WEB Application (bundle).
- Embedding OSGi container in a servlet container : it means that it’s a WEB Application which contains the OSGi container (and another bundles) which start the OSGi container. Equinox in a Servlet Container explains how this mean is done with Equinox.
You can resume « embedding OSGi container in a servlet container » like this :
HTTP Server -> WEB Application -> OSGi container.
With the articles named OSGi Equinox in a Servlet Container [step*], I will try to :
- explain step by step how use OSGi Equinox in a Servlet Container with the provided basic sample sample.http which register a servlet as an (HTTP) OSGi service.
- show you the benefit to use OSGi in the Web Application.
- show you the 2 problems coming from OSGi Equinox in a Servlet Container and how I fix that with my patch 323707.
- show you how we could use OSGi Equinox in a Servlet Container to manage Documentary Collection in a Electronic Document Management WEB application. On other words Documentary Collection is managed with an OSGi bundle that we can start/stop (with OSGi console) to register/unregister it to the Documentary Collections.