SeamFramework.orgCommunity Documentation
The SPI bundle defines how a CDI container, such as Weld, should bootstrap with the extension bundle. So any CDI environment implementation could be used by the extension bundle transparently. The CDI compliant container may be provided using an integration bundle.
This aims at providing the minimum integration in order to start a CDI compliant container with every managed bean bundle. Then the extension bundle can get a CDI container to provide to every one of its managed bean bundle.
Moreover, the integration API allows to mix CDI compliant container in the same application by providing an embedded mode. In this mode a bean bundle is decoupled from the extension bundle and is managed on its own. Thus various implementations of CDI container can be used or the behavior of a particular bean bundle can be particularized.
All this bootstrapping mechanism works using the service layer of OSGi. A CDI compliant integration bundle may provide a service that allows the extension bundle to obtain a new container for every bean bundle.
So this is where to search to make Weld-OSGi use a specific CDI compliant container.
The integration bundle is responsible for providing Weld containers to the extension bundle. It may be started with the extension bundle and publish a CDI container factory service. It requires the integration API bundle as a dependency.
The integration bundle may work this way:
BEGIN start register_container_factory_service WHILE true wait OnContainerRequest provide_container END_WHILE unregister_container_factory_service END