Eclipse does only support the DS 1.2 spec and this was added in a later version.
if you are running in a DS 1.3 environment you have to add it manually to the 
xml and cannot use the annotations.
Discussion is under way to add the functionality in Eclipse 4.7

Kind Regards

From: [] On 
Behalf Of Thomas Driessen
Sent: Thursday, March 02, 2017 2:01 PM
To: OSGi Developer Mail List
Subject: Re: [osgi-dev] Updating service properties at runtime

Thank you both for your answers.

Is it possible to directly annotate a reference with the minimum cardinality, 
or do I have to do this via ConfigurationAdmin?
In Eclipse autocomplete only shows the property cardinality which expects a 
ReferenceCardinality (OPTIONAL, MANDATORY, etc.) in the specification also only talks about how to adress this 
property via ConfigurationAdmin.

Kind regards,

------ Originalnachricht ------
Von: "Dirk Fauth" <<>>
An: "OSGi Developer Mail List" 
Gesendet: 02.03.2017 13:37:21
Betreff: Re: [osgi-dev] Updating service properties at runtime

You can find an example in one of my blog posts.

At the bottom the usage of the minimum cardinality reference property is shown.

Am 02.03.2017 1:07 PM schrieb "Carsten Ziegeler" 
You can do this with DS, have a look at section Minimum
Cardinality Property


Thomas Driessen wrote
> Hi,
> I currently have the following usecase:
> Service A depends on Service B
> Service B depends on 4x Service C
> Service A may only become active when Service B has exactly 4x Service
> C, thus becoming active itself.
> I'm using declarative services which only support 0-*, 1-*, 0-1 and
> exactly 1 dependencies between services.
> One idea I came up with, was to count the C services in B's setC(C c)
> method and, on reaching the count of 4, setting a specific property on B
> (e.g. weirdUsecaseIsActive = true) and let A's reference to B filter
> with a corresponding target filter.
> I know this sound like a dirty hack, but I did not found any better
> solutions.
> Therefore, my questions are:
> 1) Is there a better solution for my usecase?
> 2) If not: How do I update properties of a service at runtime?
> Kind regards,
> Thomas
> _______________________________________________
> OSGi Developer Mail List

Carsten Ziegeler
Adobe Research Switzerland<>
OSGi Developer Mail List<>

OSGi Developer Mail List

Reply via email to