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
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--_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.osgi.org_mailman_listinfo_osgi-2Ddev&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=p-HkGsKTJWWSiO-pz0kKXl8ALzmlqvUGeFfgHUZX8ms&m=KNdsR2O_JTMoIJPv3z_zAhrlxA4U8gi-QU86NbLSw1M&s=od1CGLzcq5KZkSVHMLAtn19Hsz53S5UV2g0HzkUrgRY&e=
_______________________________________________ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev