Hi all,

The Carbon uses Apache Aries SPI-Fly Dynamic Weaving[1] bundle to mediate
the Java ServiceLoader mechanism in the OSGi environment[2]. In order to
work the API bundles (Bundles that uses Java ServceLoader to find the
implementation classes) the SPI-Fly mediator bundle should start 1st before
those API bundles. This requires because of the SPI-Fly bundle registers a
weaving hook[3] (Class-byte modification hook) to the OSGi framework when
the bundle starts. Therefore if an API bundle starts before the SPI-Fly
bundle, the classes of the API is not modified to see the service
providers.

I'm currently working on this problem and the solution is to register the
class-byte weaving hook to the system bundle via the carbon launcher.
Therefore any class that load after the system bundle can be modified if
required.

Any feedback or suggestions are highly appreciated.

[1] http://aries.apache.org/modules/spi-fly.html
[2]  OSGi Enterprise Specification (Chapter 133 - Service Loader Mediator
Specification) https://www.osgi.org/developer/downloads/release-6/
[3] https://osgi.org/javadoc/r6/core/index.html

Thanks.
-- 
Miraj Abeysekara
Intern (Software Engineering)
Mobile: +94775690822
Twitter: https://twitter.com/MiRAGECreator
GooglePlus: https://plus.google.com/u/0/+MirageAbeysekara
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to