Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gemini » [PATCH] @Resource annotation via OSGI lookup
[PATCH] @Resource annotation via OSGI lookup [message #694102] Thu, 07 July 2011 19:51 Go to next message
Norman Maurer is currently offline Norman MaurerFriend
Messages: 8
Registered: June 2011
Junior Member
Hi there,

we at the Apache James Server project (james.apache.org) needed the possibilty to re-use our current code which heavily use @Resource annotation within spring-dm / gemini blueprint. We noticed that this was not possible without adding a new BeanPostProcessor. I would like contribute the code back if there is some interest in it. It already borrows some code from the ServiceReferenceInjectionBeanPostProcessor class.

Is there some interest in this code ? You can find it here:

http://svn.apache.org/viewvc/james/server/trunk/lifecycle-spring/src/main/java/org/apache/james/container/spring/lifecycle/osgi/OSGIResourceAnnotationBeanPostProcessor.java?view=markup
http://svn.apache.org/viewvc/james/server/trunk/lifecycle-spring/src/main/java/org/apache/james/container/spring/lifecycle/osgi/OSGIResourceAnnotationBeanPostProcessor.java?view=markup

Bye,
Norman
Re: [PATCH] @Resource annotation via OSGI lookup [message #694291 is a reply to message #694102] Fri, 08 July 2011 09:25 Go to previous messageGo to next message
Costin Leau is currently offline Costin LeauFriend
Messages: 45
Registered: February 2010
Member
Not sure what you mean by @Resource not being possible to be used? Annotations are supported transparently by Gemini Blueprint/Spring DM - see the web-console demo from the Spring DM 1.2.x samples.
If you have annotations on the imported services, make sure that:
1. you import the annotation package
2. the annotations are available on the interface that you export so the importing proxy has them available as well. With classes this is not possible since the proxying mechanism does subclassing so one needs to look at the super class for that.
Re: [PATCH] @Resource annotation via OSGI lookup [message #694307 is a reply to message #694291] Fri, 08 July 2011 09:53 Go to previous message
Norman Maurer is currently offline Norman MaurerFriend
Messages: 8
Registered: June 2011
Junior Member
When I said @Resource is not possible I tried to say that I was not be able to inject an "OSGI Service" via the @Resource annotation. It only worked for the beans in the same context. I neede to use @Resource(name="whatever") to inject the right "OSGI service" which match the ...beanname=whatever filter.

If this really should work with "plain Gemini Blueprint/Spring DM", I was not able to find the right way..

Bye,
Norman
Previous Topic:Programmly register Bean and expose as service
Next Topic:[Gemini-web] jars in WEB-INF/lib
Goto Forum:
  


Current Time: Tue Mar 19 02:15:03 GMT 2024

Powered by FUDForum. Page generated in 0.02158 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top