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

David Bosschaert do-not-reply at jboss.com
Thu May 12 09:04:58 EDT 2011


David Bosschaert [http://community.jboss.org/people/bosschaert] created the discussion

"Weld-OSGi integration in AS7"

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

--------------------------------------------------------------
Looking at the weld-osgi project ( https://github.com/mathieuancelin/weld-osgi https://github.com/mathieuancelin/weld-osgi) I've been thinking how this would ideally work in AS7.

So I started writing a little demo that does what I think would be a nice place to get to. It contains the following components:
* An API OSGi bundle. This bundle contains 2 interfaces which are shared by all the other components. 
* A provider OSGi Bundle. This bundle provides an implementation of intfA and registers that with the OSGi Service Registry.
* A .war file. This war file has a servlet that uses CDI to inject intfA into it. It also provides intfB through CDI. The servlet uses a properietary AS7 manifest header 'Dependencies' to allow it to load the interfaces from the api-bundle.
* A consumer OSGi Bundle. This consumer looks up implementations of intfB in the OSGi Service Registry and invokes on it.
 http://community.jboss.org/servlet/JiveServlet/showImage/2-604941-16366/cdiosgidemo.png  http://community.jboss.org/servlet/JiveServlet/downloadImage/2-604941-16366/450-203/cdiosgidemo.png 
So the servlet has a dependency on an OSGi service, and the consumer-bundle has a dependency on a CDI bean provided in the .war file.

The code for the demo is here:  https://github.com/bosschaert/coderthoughts/tree/master/CDI https://github.com/bosschaert/coderthoughts/tree/master/CDI
Just run mvn install to build it all.

The question is: what needs to be done to get this demo to work?
--------------------------------------------------------------

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

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/20110512/d501569e/attachment.html 


More information about the jboss-dev-forums mailing list