Right, you need to REQUIRE a configuration for your component you. In
that case it's only activated if there is a configuration.

If the configuration is optional and you still want to know whether the
component got one, you can get the ServiceReferenceDTO from the
ComponentConfigurationDTO and check for the service.pid property in the
service reference

Regards

Carsten


Osgi Developer Mail List wrote
> From the top of my head configuration is by default optional but there
> was way to say that configuration is required. Is such cases if
> configuration is not provided you should get UNSATISFIED_CONFIGURATION 
> 
> On Tue, Apr 17, 2018 at 4:54 PM, Christian Schneider via osgi-dev
> <osgi-dev@mail.osgi.org <mailto:osgi-dev@mail.osgi.org>> wrote:
> 
>     I am currently working on root cause analysis for DS components. To
>     do this I rely on the ServiceComponentRuntime service.
> 
>     I got the description of this component in 
>     ComponentDescriptionDTO desc;
> 
>     and I can get configurations for it using:
>     Collection<ComponentConfigurationDTO> configs =
>     scr.getComponentConfigurationDTOs(desc)
> 
>     I wonder how to correctly detect the state of a missing configuration.
> 
>     There is the configuration state UNSATISFIED_CONFIGURATION but how
>     can it occur?
>     If my component has no config then getComponentConfigurationDTOs
>     returns an empty list and if a configuration is present it can not
>     be unsatisfied, can it?
> 
>     Best
>     Christian
>     -- 
>     -- 
>     Christian Schneider
>     http://www.liquid-reality.de
> 
>     Computer Scientist
>     http://www.adobe.com
> 
> 
>     _______________________________________________
>     OSGi Developer Mail List
>     osgi-dev@mail.osgi.org <mailto:osgi-dev@mail.osgi.org>
>     https://mail.osgi.org/mailman/listinfo/osgi-dev
>     <https://mail.osgi.org/mailman/listinfo/osgi-dev>
> 
> 
> 
> 
> -- 
> http://about.me/milen
> 
> 
> _______________________________________________
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev
> 
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to