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
Jens

From: osgi-dev-boun...@mail.osgi.org [mailto:osgi-dev-boun...@mail.osgi.org] 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.)
112.6.2.2 in the specification also only talks about how to adress this 
property via ConfigurationAdmin.

Kind regards,
Thomas

------ Originalnachricht ------
Von: "Dirk Fauth" <dirk.fa...@gmail.com<mailto:dirk.fa...@gmail.com>>
An: "OSGi Developer Mail List" 
<osgi-dev@mail.osgi.org<mailto:osgi-dev@mail.osgi.org>>
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.

http://blog.vogella.com/2016/09/26/configuring-osgi-declarative-services/

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

Am 02.03.2017 1:07 PM schrieb "Carsten Ziegeler" 
<cziege...@apache.org<mailto:cziege...@apache.org>>:
You can do this with DS, have a look at section 112.6.2.2 Minimum
Cardinality Property

Regards
Carsten

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
> osgi-dev@mail.osgi.org<mailto:osgi-dev@mail.osgi.org>
> https://mail.osgi.org/mailman/listinfo/osgi-dev
>




--
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org<mailto:cziege...@apache.org>
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org<mailto:osgi-dev@mail.osgi.org>
https://mail.osgi.org/mailman/listinfo/osgi-dev

_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to