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 Hargrave
Senior Technical Staff Member, IBM // office: +1 386 848 1781
OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788
hargr...@us.ibm.com
 
 
----- Original message -----
From: Christian Schneider via osgi-dev <osgi-dev@mail.osgi.org>
Sent by: osgi-dev-boun...@mail.osgi.org
To: OSGi Developer Mail List <osgi-dev@mail.osgi.org>
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=<uuid of my framework>)
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
 
 

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

Reply via email to