Re: [osgi-dev] Setting reference target in component

2018-08-01 Thread Alain Picard via osgi-dev
Thanks Tim. I had read that thread but didn't make the association. I think
my case falls between some of the described solutions and part of your
point in 2, a bit of redesign :)

Alain


On Tue, Jul 31, 2018 at 12:42 PM Tim Ward  wrote:

> This sounds like a variation on this question
>  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/
> 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
> and
> 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

Re: [osgi-dev] Setting reference target in component

2018-07-31 Thread Tim Ward via osgi-dev
This sounds like a variation on this question 
 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  
> 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/
>  
> 
>  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
>  
> 
>  and 
> 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

[osgi-dev] Setting reference target in component

2018-07-31 Thread Alain Picard via osgi-dev
 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/
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
and
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