Re: [osgi-dev] Can a DS component control its service properties programmatically?

2018-02-13 Thread BJ Hargrave via osgi-dev
You could do this by using a component factory. You would need another component to get the ComponentFactory service and call ComponentFactory.newInstance with the desired endpoint.framework.uuid service property.
 
But this is probably overkill for a single service. For a single service, you can use the life cycle methods of a component (activate/deactivate) to manually register/unregister the desired service.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Christian Schneider via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] Can a DS component control its service properties programmatically?Date: Tue, Feb 13, 2018 6:11 AM 
I would like to create a component that is an remote service admin EndpointEventListener. 
So it needs a property endpoint.listener.scope with a filter string. 
The problem now is that I want this scope to only include endpoints from the local framework. So I need something like:
(endpoint.framework.uuid=)
So I think I can not do this using the @Component annotation. Can I set this property in the @Activate method somehow?
 
Christian
 --

--Christian Schneiderhttp://www.liquid-reality.de
 
Computer Scientist
http://www.adobe.com
 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://urldefense.proofpoint.com/v2/url?u=https-3A__mail.osgi.org_mailman_listinfo_osgi-2Ddev=DwICAg=jf_iaSHvJObTbx-siA1ZOg=p-HkGsKTJWWSiO-pz0kKXl8ALzmlqvUGeFfgHUZX8ms=KNdsR2O_JTMoIJPv3z_zAhrlxA4U8gi-QU86NbLSw1M=od1CGLzcq5KZkSVHMLAtn19Hsz53S5UV2g0HzkUrgRY=
 

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

Re: [osgi-dev] Can a DS component control its service properties programmatically?

2018-02-13 Thread Carsten Ziegeler via osgi-dev
DS does not provide any way to do so.

Why not using the framework API and register that listener "by hand"?
This could be a small facade around your component.

Another more complicated solution would be you require a configuration
for your component and in the activator you create an OSGi configuration
with the framework uuid. This gets then picked up by DS and applied as
service properties. But that already looks like a lot of overengineered.

Regards

Carsten


Osgi Developer Mail List wrote
> I would like to create a component that is an remote service admin
> EndpointEventListener. 
> So it needs a property endpoint.listener.scope with a filter string. 
> The problem now is that I want this scope to only include endpoints from
> the local framework. So I need something like:
> (endpoint.framework.uuid=)
> So I think I can not do this using the @Component annotation. Can I set
> this property in the @Activate method somehow?
> 
> Christian
> 
> -- 
> -- 
> Christian Schneider
> http://www.liquid-reality.de
> 
> Computer Scientist
> http://www.adobe.com
> 
> 
> 
> ___
> 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