I’m not quite sure exactly what you are asking, and I don’t know what policy 
preference this plugin thinks is a good idea but...
If a static reference goes away, of course the component instance will get 
deactivated, and if there’s another suitable service available a new instance 
will get activated. This happens with both static and greedy policies.  With a 
greedy static reference, these will also trigger instance cycling:
- single cardinality: a better match (service ranking) appearing.
- multiple cardinality: more matches appearing.

Unless you’ve set the minimum cardinality using config admin to the actual 
number of services, you probably want the greedy behavior for multiple 
cardinality references. The situation for single cardinality is more debatable.

David Jencks 


Sent from my iPhone

> On Sep 25, 2018, at 3:51 PM, Mark Derricutt <[email protected]> 
> wrote:
> 
> Hey all,
> 
> A question on checkGreedyReferences() in the new osgicheck-maven-plugin, we 
> got a lot of warnings about our static @Reference's needing to be greedy.
> 
> From the ReferecePolicy.STATIC java doc:
> 
> If a target service is available to replace the bound service which became 
> unavailable, the component configuration must be reactivated and bound to the 
> replacement service.
> 
> Would this imply that regardless of the RELUCTANT/GREEDY setting, for a 
> static @Reference I should see the new/updated service - and if so, should 
> the warning only trigger for non static references?
> 
> Mark
> 
> "The ease with which a change can be implemented has no relevance at all to 
> whether it is the right change for the (Java) Platform for all time." — Mark 
> Reinhold.
> 
> Mark Derricutt | Senior Developer
> Phone: +64 9 302 0515 Fax: +64 9 302 0518
> Mobile: +64 21 562 533 Freephone: 0800 SMX SMX (769 769)
> Twitter: @talios
> SMX Limited: Level 10, 19 Victoria Street West, Auckland, New Zealand
> Web: http://smxemail.com
> 

Reply via email to