Hi all,
I began completing the OSGi WAB support that Thomas started some time
ago. The first piece I looked at is AS7-5203 which gives Servlets access
to the OSGi BundleContext via the ServletContext.
Before filing a pull I'm looking for some feedback on how I implemented
this. Maybe people have thoughts re how it can be improved or
simplified. It currently works like this:
* I added a DeploymentUnitProcessor in the REGISTER phase that adds a
WebContextFactory.ATTACHMENT to the deployment unit.
* This attachment is picked up by JBoss Web (it already provided this hook).
* When the Bundle representing the WAB is started it calls back into the
WebContextFactory to set the BundleContext in the ServletContext. It
does this via a MSC Service that in turn uses an OSGi BundleListener.
The changes are here:
https://github.com/bosschaert/jboss-as/commit/9ab72ce08a3357a3e6fdb1a68c2...
Thanks,
David