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)?
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.
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.