That was written by me.  The basic premise behind the experiment was to ensure (prove) that we could have bidirectional support between JPMS and OSGi if the demand becomes high for such a thing.  Up front, I have not seen that demand arise as of yet.  But we will see as Java 9 gains adoption.  I worked with the jigsaw team to get some changes necessary into Java 9 in order to allow such a JPMS Layer to be created that hosts and the OSGi framework (Equinox in this case) and a set of OSGi bundles as JPMS modules.  Java 9 was a moving target for much of the last year, so it would have been premature to base a new specification at this time.
 
At this point that is really just a proof of concept on one possible direction that could be taken in a future OSGi specification.  The approach works in theory, but has several warts that I think will prevent it from getting fully realized in the specification.  For example, we have to place each bundle in its own JPMS Layer in order to work around issues with dynamics, cycles, split packages etc.  This causes us to have to add our own read edges between the OSGi bundle modules to get the same behavior we had before JPMS.  This leaves us with having to work around the JPMS resolver and extra overhead of managing a 1-1 mapping between a JPMS Layer and an OSGi bundle.  That concerns me because it means such an approach will always get penalized with a performance cost (that is not low) for large sets of OSGi bundles.
 
I've been working with OSGi technologies for a long time now, to be honest, module systems are boring.  The real value of OSGi, in my opinion, is not all the bells and whistles provided by its module layer but instead the service layer which all other OSGi specifications are built upon.  For Java 9 (or any other module system) I think we need to ask, how can we get the OSGi service layer to work in that module system without requiring the OSGi module layer to be in control of the class loaders?  That is another direction the OSGi specification could take with respect to Java 9.  But don't take that as an official statement from the OSGi Alliance.  That is just my opinion as a long time OSGi expert.

Tom
 
 
 
----- Original message -----
From: Simon Spero <sesunc...@gmail.com>
Sent by: osgi-dev-boun...@mail.osgi.org
To: OSGi Developer Mail List <osgi-dev@mail.osgi.org>
Cc:
Subject: Re: [osgi-dev] OSGi and Java 9
Date: Thu, Sep 7, 2017 4:34 PM
 
On Thu, Sep 7, 2017 at 5:15 PM, Mark Raynsford <list+org.o...@io7m.com> wrote:
On 2017-09-07T20:31:19 +0000
"BJ Hargrave" <hargr...@us.ibm.com> wrote:

> If you are asking about how you can install JPMS modules in an OSGi framework just like bundles, then there is no answer for that at this time that I am aware of.


Someone did a proof of concept that provides some degree of interaction between bundles and JPMS modules. I'm not completely clear on the details:

  https://github.com/tjwatson/osgi-jpms-layer
 
(Guess where he works :-) 
 
There are a couple of blog posts  describing this work:
 
 
I also seem to recall that David Lloyd at Red Hat also did some experimental hackery.
 
 
 

_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to