|Replacing OSGI bundles in the running environment [message #834901]
||Mon, 02 April 2012 10:36
| Piotrek De
Registered: March 2012
I have split my application into several OSGI bundles and one OSGIfied WAR.
Some of my bundles depends on others in a meaning that they import packages exported by other bundles. Exactly the same is with my WAR - it imports some packages exported by other my bundles. So far everything works fine - bundles must be deployed to virgo in a specific order so that dependencies are satisfied and my WAR works as expected.
What I'm trying to achieve is to replace some bundle in the running environment. Let's say that my WAR imports packages from bundles A,B,C and application works on production Virgo server. When QA reports bug and it affects only module A, I'd like to be able to replace only module A, having all other system components running unaffected. (With standard approach, I'd have to redeploy entire application - WAR along with all its JARs embedded - it causes that for some time my server does not respond).
Is it possible with OSGI?
With my current configuration, with all bundles and WAR in the "ACTIVE" state, when I stop bundle "A", it changes its state to "RESOLVED". I can also uninstall this bundle, and install it again. During all these operations, entire system works fine (WAR responds for requests). But when the actual reload/upgrade of classes takes place? My WAR is based on Spring framework, so all instances are available in container. Thus, probably, they will never get upgraded, until I'll restart the container/WAR. Is that true? Are there any other approaches to achieve what I want to do?
Thanks in advance for any hints!
[Updated on: Mon, 02 April 2012 10:44]
Report message to a moderator