On Tue, May 11, 2010 at 14:08, Rickard Öberg <[email protected]> wrote:
> Hey,
>
> I'm looking into using GlassFish and OSGi as the runtime environment for my
> Qi4j app. There seems to be a bunch of options available, but here's what I
> have in mind no. Feedback most welcome on whether it makes sense or not.
>
> Basically I want to have one bundle with a BundleActivator that instantiates
> Qi4j and creates the ApplicationAssembly. It will call all my assemblers
> (50+) to "fill in" all the Modules in all the Layers. Those assemblers are
> in other bundles though. The classes in those other bundles are referred to
> by classname so there is no Class.forName() going on.
>
> Once all assemblers have done their thing, the main BundleActivator can
> instantiate and start the application. From here on it's pretty
> straightforward.
>
> The trick is what happens when I redeploy a bundle. My idea is that this
> will cause the application to stop, the bundle redeploys, and then the main
> bundle rebuilds and starts the app again.
>
> The gain is that I don't have to restart the whole server and reload all
> classes and such. The downside is that there will still be some overhead in
> restarting the app instance.
>
> Does that seem to be a reasonable approach? Any other ideas on how to make a
> Qi4j app work in OSGi well?
There are several level of compliance:
1. Simplest way (you discovered this):
All jars are library bundles, and there's only one bundle activator
and this one bootstrap the qi4j application.
Downside:
* Hard coding of the application layout in advance.
* Qi4j application is shutdown when any qi4j application related
bundle is down.
2. Step 1 + Config admin + Layer / Module bootstraper as OSGi services
Benefit:
* You can partition qi4j application in single instance of glassfish
* You can configure which bootstrapper involved for which qi4j application
* No need to repackaging bundle activator per application
Downside:
* Increase complexity
* Qi4j application is shutdown when any qi4j application related
bundle is down.
3. Step 1 or 2 but split qi4j application to smaller application,
integrate between qi4j applications via OSGi services
Benefit:
* All step 1 or 2 benefits
* One sub application down does not mean down for the entire system.
You can partially upgrade qi4j application without shutting down
the entire system.
Downside:
* Increase complexity
1-3 should be relatively simple?
with 1 as the simplest :)
Regards,
Edward Yakop
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev