mathieuancelin / weld-osgi

This project aims to provide an OSGi integration for Weld. This project is no longer updated, see https://github.com/weld/core for updates
https://github.com/weld/core
12 stars 10 forks source link

Implementation bundle should be able to load CDI extensions from the extension bundle #64

Closed arcane86 closed 13 years ago

arcane86 commented 13 years ago

Currently it is necessary to copy the /META-INF/services/javax.enterprise.inject.spi.Extension file into the implementation bundle to enable CDI OSGi extension.

mathieuancelin commented 13 years ago

I don't understand the issue well. Is it a clone of #37 ?

Can you explain differences ?

arcane86 commented 13 years ago

Okay, for me an extension must be declare in a bean bundle only: any /META-INF/services/javax.enterprise.inject.spi.Extension file should get a /META-INF/beans.xml file in the same bundle. That is because the extension file is scanned by the CDI container (so in a regular bundle extension files are ignored).

However, the extension bundle declare a /META-INF/services/javax.enterprise.inject.spi.Extension file but is not a bean bundle: the extension file must replicated in all CDI implementation bundles. It'll be cool to find a mechanism that allows the implementation bundle to load the extension file directly from the extension bundle.

mathieuancelin commented 13 years ago

Okay, I didn't understand at all :)

The real issue here is that the SPI mechanism isn't working correctly because of the bundle architecture. As said in the #37 we need to simply get it right.

For the CDO-OSGi extension itself, it's maybe better to stay with the extension file in every implementation, or maybe we should leak the extension in integration api so the implementation bundle can add the extension at startup

mathieuancelin commented 13 years ago

Merged with #37