Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gemini » Blueprint missing @ServiceReference annotation
Blueprint missing @ServiceReference annotation [message #903204] Wed, 22 August 2012 13:48 Go to next message
Erko Knoll is currently offline Erko Knoll
Messages: 5
Registered: December 2011
Junior Member
Spring DM had @ServiceReference annotation alternative to XML service injection which was really nice. The problem is that this annotation is nowhere to be found with blueprint release.

I know that they state that "The plans for the Maven archetype and annotation extension are undefined for the moment." is reasonable explanation, but for some reason some of the references are still existing such as "org.eclipse.gemini.blueprint.extensions.annotation" package use can be found from multiple sources except the .jar itself that contains it. For example "org.eclipse.gemini.blueprint.extender.internal.support.OsgiAnnotationPostProcessor" tries to load "org.eclipse.gemini.blueprint.extensions.annotation.ServiceReferenceInjectionBeanPostProcessor" class which was used for Spring DM only the base package is renamed.

I also tried to add old spring.osgi core, extender and io bundles to get the annotations working but that resulted in massive "Required 'bundleContext' property was not set." exceptions.

Server: Virgo 3.5.0

My question is: how am I supposed to make it work without that annotation (I don't want to go back to XML configuration, defeats the purpose of having Spring 3)?
Re: Blueprint missing @ServiceReference annotation [message #903359 is a reply to message #903204] Thu, 23 August 2012 10:39 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
Annotations were not part of Spring DM 1.x core - they were never properly reviewed (hence the different package and the note in the documentation that they are extensions rather than part of the core).

Spring DM 2.0/Gemini Blueprint would have been a good opportunity to bring annotations into the core, but this was not done and they were ditched, particularly since Gemini Blueprint was focused on Blueprint spec support and less on Spring.

If someone wants to resurrect the annotation extension, that would be one step forward. Meanwhile XML is the only alternative.

Please feel free to raise an enhancement bugzilla if you would like to get this requirement on the books.
Re: Blueprint missing @ServiceReference annotation [message #903415 is a reply to message #903359] Thu, 23 August 2012 14:36 Go to previous messageGo to next message
Erko Knoll is currently offline Erko Knoll
Messages: 5
Registered: December 2011
Junior Member
Thanks for the answer. I kind of suspected that they are not present. So I ported over that feature myself.

Basically what I did is I got rid of depreciated stuff and replaced the cardinality logic with availability.

Works the same way as it did before but now cardinality annotation property takes Availability enum. Like this @ServiceRerefence(cardinality=Availability.MANDATORY). Also the base package has been renamed to org.eclipse.gemini.blueprint.extensions.annotation.

Works for my project. Would be really nice if someone who comprehends the Blueprint more than me reviewed it. I just started yesterday to port my project from Spring DM over to Blueprint.

If you Blueprint guys think that could be useful for someone else feel free to take the source and add to your sub-project.

[Updated on: Sun, 26 August 2012 12:41]

Report message to a moderator

Re: Blueprint missing @ServiceReference annotation [message #1072294 is a reply to message #903204] Mon, 22 July 2013 13:26 Go to previous messageGo to next message
Roger Stocker is currently offline Roger Stocker
Messages: 16
Registered: July 2009
Junior Member
Wrong post, should be deleted...

[Updated on: Mon, 22 July 2013 13:29]

Report message to a moderator

Re: Blueprint missing @ServiceReference annotation [message #1072295 is a reply to message #903415] Mon, 22 July 2013 13:27 Go to previous message
Roger Stocker is currently offline Roger Stocker
Messages: 16
Registered: July 2009
Junior Member
I'd like to use your ServiceReference annotation, but I need some more information, because in my setup it is ignored.

The extensions bundle is in state active, as expected, and I have a bean using @ServiceReference for a valid OSGi Service, but it's not injected.

What else do I have to do in order to let Spring do the postprocessing?

Thanks
Previous Topic:Gemini JPA: Getting Started?
Next Topic:Missing MySql constraint
Goto Forum:
  


Current Time: Tue Sep 30 10:11:26 GMT 2014

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

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