Thanks everyone. I've been reading through the javadoc. Thanks also for 
reminding me to RTFM:) Not all of it is clear but it certainly helps a great 
deal.

D

On 02/02/2017 10:31 PM, Tim Ward wrote:
Yes - the Reference annotation has a number of useful properties that you can 
set to control its behaviour.

Tim

Sent from my iPhone

On 2 Feb 2017, at 22:45, Dario Amiri 
<[email protected]<mailto:[email protected]>> wrote:


The javadoc is unclear about where to use it. Is this a setting on the 
Reference annotation itself?

On 02/02/2017 09:46 AM, Timothy Ward wrote:
I did not understand your comment on "Declarative Services with a static
policy". I'm ignorant of this concept. Is there some documentation I can
look at to better understand what that means?

The JavaDoc is actually pretty good!
https://osgi.org/javadoc/r6/cmpn/org/osgi/service/component/annotations/ReferencePolicy.html#STATIC


Finally, I am using the maven-bundle-plugin with the "_dsannotations"
tag to process the declarative services annotations. Is there a better way?

There are different ways, but not necessarily better. The bnd-maven-plugin is 
another choice for generating your OSGi metadata, and it automatically picks up 
the annotations. It’s doing the same thing under the covers (even using the 
same library), just with some slightly better default configuration and tooling 
support. I must admit to being biased though, as I actually write some of the 
plugins in that project.

Regards,

Tim

On 2 Feb 2017, at 16:30, Dario Amiri 
<[email protected]<mailto:[email protected]>> wrote:

Thank you Timothy.

It was the @Reference on the unbind that was creating the problem. I
don't know why I didn't catch that especially since I have another
@Reference right next to that one where I did not make the same mistake.
I guess there's no substitute for a second pair of eyes - makes me wish
I could go back to pair programming.

I did not understand your comment on "Declarative Services with a static
policy". I'm ignorant of this concept. Is there some documentation I can
look at to better understand what that means?

Finally, I am using the maven-bundle-plugin with the "_dsannotations"
tag to process the declarative services annotations. Is there a better way?

Thanks again,

D

On 02/02/2017 08:10 AM, Timothy Ward wrote:
The next thing to check is, are you using a tool which processes the 
Declarative Services annotations when building the bundle? Does the bundle have 
a Service-Component header and a matching XML file? I’m guessing that you 
probably do as you refer to the reference not being set, but it’s still worth 
checking!




Reply via email to