This sounds like a variation on this question 
<https://mail.osgi.org/pipermail/osgi-dev/2018-July/006937.html> asked a few 
weeks ago in the osgi-dev list.

In summary, there are a couple of ways to achieve what you’re trying to do, and 
using configuration admin may or may not be the best approach given that you 
want to request an instance which you directly control the lifecycle of. 
Hopefully the thread will give you the answer that you’re looking for.

Best Regards,

Tim

> On 31 Jul 2018, at 13:24, Alain Picard via osgi-dev <osgi-dev@mail.osgi.org> 
> wrote:
> 
> I need to configure some Component to be session scoped. I have followed the 
> article from Dirk at 
> http://blog.vogella.com/2017/02/24/control-osgi-ds-component-instances-via-configuration-admin/
>  
> <http://blog.vogella.com/2017/02/24/control-osgi-ds-component-instances-via-configuration-admin/>
>  which matches what I want.
> 
> But in my case the Component that configures the service is also the has a 
> reference to this service. I read a couple of SO about this 
> (https://stackoverflow.com/questions/47393876/dynamically-setting-target-property-in-osgi-reference-annotatation
>  
> <https://stackoverflow.com/questions/47393876/dynamically-setting-target-property-in-osgi-reference-annotatation>
>  and 
> https://stackoverflow.com/questions/21166070/osgi-declarative-services-filter-references-at-runtime
>  
> <https://stackoverflow.com/questions/21166070/osgi-declarative-services-filter-references-at-runtime>)
>  but I'm struggling to figure out the best way to both specify a 
> configuration as per the 1st article and then set the target in my component 
> to the resulting instance (and/or getting a component configuration and set 
> the target for my service).
> 
> Thanks
> Alain
> 
> _______________________________________________
> OSGi Developer Mail List
> 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