New issue 55 by matthias...@gmx.de: Integration between the Activation
bundle and the GuiceExtensionFactory
http://code.google.com/p/peaberry/issues/detail?id=55
The Activation bundle and the GuiceExtensionFactory seem to make a
perfect pair for developing Eclipse RCP applications. You don't have
to write any bootstrap code and may use osgi Declarative Services (DS)
without any additional efforts.
After I played around with this scenario for a few hours, I noticed
that the GuiceExtensionFactory creates a new Injector for each module,
even if an
Injector has already been created for that bundle. I don't think that
this makes any sense because the scope of a singletons belongs to it's
Injector (Singletons are created multiple times, one for each Injector).
I noticed that the Spring guys found a nice solution to this by using
an ServiceTracker to retrieve the existing applicationContext from the
osgi environment. If there is any Interest, I could provide a patch
for this. (*http://tinyurl.com/5sgzhxw)*
Are there any upcoming releases? Or has the development been stopped
because auf E4's DI support?
I don't quite understand why do you need to use OSGi DS together with
Peaberry. Just Peaberry is sufficient to handle dynamic services and IMO in
a better way than OSGi DS.
Sorry for not being clear enough on this. I use Peaberry for exporting OSGi
DS.
This problem ist just, that the GuiceExtensionFactory is creating it's own
Injector, even if an Injector has already been created for the bundle.
I've been gradually moving peaberry's OSGi functionality over to our new
JSR330 based container "sisu-inject" which is already used in Maven3 and
Nexus (https://github.com/sonatype/sisu). Sisu (when run in OSGi mode) uses
a service listener to track bundle injectors to avoid duplicates. The
equivalent GuiceExtensionFactory is not fully functional yet (full OSGi
support is scheduled for the upcoming 2.3.0 release) but the basics are in
place.
So while my focus at the moment (and the foreseeable future) is
on "sisu-inject", if you want to patch peaberry to fix this particular
problem then I'm happy to merge it in and roll out a new release.