On Wed, Mar 25, 2009 at 11:33 PM, Greg Brown <[email protected]> wrote:
> Hi all,
>
> Now that we're pretty much done with version 1.1, we're starting to think 
> about features for the next release of Pivot, version 1.2. One topic that has 
> been discussed is OSGi support. We understand OSGi from a high level and 
> think that support for OSGi-style modules or bundles would be a valuable 
> addition to Pivot. However, we don't know enough about it to know if this is 
> something that we'd need to build from scratch or if there are existing Java 
> libraries that we could take advantage of.
>
> If anyone has relevant experience and would care to share your insight, we 
> would appreciate it.


This thread has generated more content than I have time to read now.

I have worked extensively on OSGi over the last 4-5 years, and seen
all the good and bad sides of it.

IMHO, Pivot should probably not be dependent on OSGi, and instead just
make sure that OSGi issues are taken care of (if possible).

The main problem with OSGi is 'blindless classloading', i.e. all
applications that does a loadClass() or forName() will have issues.
This includes serialization, persistence and configuration stuff. I
have not gone over the code to see how much of this Pivot do, but if
you have any loadClass, you should break out and allow a custom
classloading hook.
The other thing is that Pivot's artifacts being proper bundles is also
a nice thing for OSGi developers. I recommend that the Maven Bundle
Plugin (hosted at Felix) is used. In essence, it will assist you in
making sure that the Bundle Manifest is correct, and remind you when
you add new packages and forget to add them to the 'recipe'. It does
so by introspecting the class files exclusively.

For fooling around and testing OSGi in general, I must recommend Pax
Runner (wiki.ops4j.org), since it literally does all the setup of the
framework for you (in any of the 3 frameworks you choose), and you
should be up and running in minutes instead of hours and days. The Pax
project also have tooling for in-container testing, development aids
and others. Also, the Pax team develops PeaBerry, which is OSGi
integration for Guice, but that one is hosted on Google Code.



Cheers
Niclas

-- 
http://www.qi4j.org - New Energy for Java

Reply via email to