[jboss-dev-forums] [JBoss AS7 Development] - Re: Weld-OSGi integration in AS7

Kevin Pollet do-not-reply at jboss.com
Fri May 13 05:31:25 EDT 2011


Kevin Pollet [http://community.jboss.org/people/kevinpollet] created the discussion

"Re: Weld-OSGi integration in AS7"

To view the discussion, visit: http://community.jboss.org/message/605120#605120

--------------------------------------------------------------
Hi David,

First of all really nice demo. And I think we all agree that we want to see it working one day :-)
Mathieu and I have a long discussion about that and this is our thoughts.

The very first step is to mark the CDI service as publishable in the OSGi world. Here we have two options. First one, we put an annotation on the service implementation to mark it publishable (like Weld-OSGi @Publish). The other, as says Ales, is to publish all CDI beans as OSGi services and we agree when he says that this option sounds overkill.

Now that the service is marked has publishable, we need to publish it :-) One solution might be to create a pure CDI extension which scans the @Publish annotation and talk to an OSGi bridge (provided by the container, here the web container). But in the idea this bridge is not in the OSGi spirit. This bridge could offer an API with differents methods like register... (something like  https://gist.github.com/970202 https://gist.github.com/970202). Here we can easily see that the symetric approach could be done with this stuff. It will be easy to inject OSGi services into a JavaEE application with this mechanism.

WDYT?

Another point is that this reflexion is not related to Weld-OSGi. I mean that this stuff was initially done to make Weld working in an OSGi container and to provide an extension based on it to simplify the use of OSGi with a CDI approach. Regarding your example, what do you think about adding a new bundle which consume the service B with Weld-OSGi?

Cheers,
Kevin & Mathieu
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/605120#605120]

Start a new discussion in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20110513/28d0d80d/attachment-0001.html 


More information about the jboss-dev-forums mailing list