advice on moving to production server
Using Spring DM 1.2.0 and Spring DM Server (very recent snapshot). Seeking some advice on production deployment options for my situation:
1. I have a legacy WAR that's been *mostly* converted to a "shared services" WAR. This WAR serves up the web side of my app, and has a lot of code that is seriously OSGi unfriendly (it has Grails in it). It's not feasible to break up this WAR any further - I'm going to have to live with it until I can slowly replace it entirely with bundles.
2. Alongside this I have a few dozen Spring DM bundles that provide the bulk of the services and domain layer.
Running the app on my development machine is easy with Eclipse and the Spring DM Server tools. I can boot up my bundles in a defined order, and when they're done I can drop the WAR file into the pickup directory. The app boots fine and everyone is happy.
Here's my dilemma. I'd like to move everything to a production server running Spring DM Server. I need to be able to swap in and out bundles at runtime without tearing down the WAR on every bundle event. I'd also like to have a way for the server to survive a reboot. Below are the options I've considered and the reasons I can't fully implement any of them. I'm *hoping* that my facts are wrong on one or more of these options, or that someone has an idea that I haven't thought of.
1. Use a .plan file to dictate the bundles to start, in order, with the WAR as the last bundle. This won't work because .plan files don't support WAR files.
2. Use a .plan file to start *just* my bundles, in order, and then drop the WAR in the pickup directory. I could live with this, but given that I need to "hot swap" bundles, I want the atomicity of the .plan file to be false. And since I need the WAR to "see inside" to the bundles' services, I need to declare the scope of the .plan file to "global". When I tried to do this, I get an error from the server that I can't choose atomic=false and scope=global at the same time. I'm aware that services can "punch out" of their scope with
Code:
<osgi:service-properties>
<entry key="com.springsource.service.scope" value="global" />
</osgi:service-properties>
but I need my packages to be visible to the WAR file as well, not just the services.
3. Drop all my bundles into the pickup directory one by one, in the order I want, then drop the WAR in. This won't survive a reboot and obviously isn't very elegant.
Hope this all makes sense. Any ideas would be greatly appreciated.