I have one big web-application(running in tomcat container) which inturn contains some plug-ins.Each plug-in is associated with a spring application context.In order to support versioning of plug-ins I would like to move to OSGi+Spring.I want to make each plug-in a spring powered bundle.This way, I can also install/uninstall the plug-in bundles without stopping the web-application.
Now the question is, how do I deploy these bundles in Tomcat?I understand I have the following options.
option 1: Embed OSGi platform inside my web application,then use Spring DM(extender)to discover my spring powered plug-in bundles.I will use an equinox servlet bridge for web support.
option 2: The Spring-DM way,by OSGIfying my tomcat container and then deploying my web-application as WAR bundle.
a)Can I still have the spring powered plug-in bundles inside my main web-application WAR bundle, as there is no need to share them across multiple web-applications?
b)With OSGIfied tomcat container,concurrently can I still run other non-osgi web-applications?
When we should choose option1 or option2?
Thanks in advance