aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: CDI annotations in OSGi
Date Sun, 25 Mar 2012 20:12:51 GMT
I _really_ don't think you want to reimplement OWB.

I think more annotations are the way to relate to osgi services.  I suspect a CDI construct
like an extension would be the way to go, CDI is designed to be pretty extensible.

I'd ask on the OWB list to see if anyone has worked on this already.

david jencks

On Mar 25, 2012, at 11:00 AM, Christian Schneider wrote:

> What I could imagine is to combine blueprint and CDI. So for example you could define
a <reference id="..." interface="..."/> in your blueprint file and then
> inject it into a CDI class with @Inject. Of course there could be some problems in details
but it might work fine.
> 
> So what I imagine is to use CDI to wire the inner workings of a bundle and use EJBs or
OSGi services to wire your bundles. Basically blueprint does this too but I think the inner
wirings of a module can be done much more efficiently using CDI.
> 
> About dragging in most of javaee. When using a complete implementation like OpenEJB this
is probably the case but we could also just also implement the CDI annotation wiring for blueprint.
There are only two things we should really be careful with.
> 
> The first is: What happens if two CDI engines run in OSGi. I read that the current OpenEJB
OSGi impl automatically processes bundles with annotations. So if blueprint also does the
same it could become a problem. I think for this case the OSGi requirements/capabilites could
work. So we could have capabilities for blueprint and JavaEE. The user bundles could then
specify which they depend on and so the engines could work on the bundles more selectively.
> 
> The second is: We have to make sure to implement the annotations like described in the
spec. If not then having the same annotation that works differently could really confuse developers.
> 
> So if there is interest I would volunteer to write a proof of concept to implement a
subset of CDI that works together with blueprint. I guess the current blueprint annotations
code should be a good starting point for this.
> 
> Christian
> 
> 
> Am 25.03.2012 18:01, schrieb David Jencks:
>> Getting OWB to work in a plain osgi environment should not be too hard.  I think
the CDI annotation model is a lot better in all ways than blueprint.
>> 
>> I think what's missing is the connection to OSGI services.  To be more than a self-contained
set of components with no relationship to anything outside the bundle you need a way to consume
osgi services from CDI components and expose CDI beans as services.  I haven't seen a proposal
on how to do this.
>> 
>> I'm also not sure if CDI will automatically drag in most of javaee....
>> 
>> thanks
>> david jencks
>> 
>> On Mar 25, 2012, at 3:13 AM, Christian Schneider wrote:
>> 
> 
> -- 
> 
> Christian Schneider
> http://www.liquid-reality.de
> 
> Open Source Architect
> Talend Application Integration Division http://www.talend.com
> 


Mime
View raw message