On Thu, Nov 6, 2014 at 4:06 PM, Tommaso Teofili <[email protected]> wrote: > I'm a bit skeptical not because it wouldn't work but mostly because the > correct behavior would depend on oak-lucene SPI users to read the doc :-)
Agreed yes. But then we do not have any other option and limiting features due to this issue would not be good. In a non OSGi world people can anyway do that easily > Another concern (but I'm not 100% sure) is that this may break setups where > Lucene classes would be exported correctly by some other > Lucene-over-OSGi-enabling-bundle (e.g. ServiceMix) and used by other > non-Oak-bundles. For that we make use of mandatory package attributes [1] (rather esoteric feature!). It basically involvex specifying some attribute while exporting the package. For that package to be imported the importer must specify the attribute in import-package directive. So on Oak side when we export the Lucene package we set attribute Export-Package: org.apache.lucene;provider="oak";mandatory=:provider And on import side the importer must specify the attribute Import-Package : org.apache.lucene;provider="oak" This would ensure that only bundles which need to extend Oak Lucene import the required package and our export would not pollute the existing OSGi package namespace Chetan Mehrotra [1] http://www.osgi.org/download/r4v41/r4.core.pdf (Sec 3.6.6 pg 45)
