There is not plan for Declarative Services to have an API for imperatively creating components/services. The whole point of Declarative Services is the declarative nature of it. You can always use the service APIs of the framework to create services. Or something like felix dependency manager.
--
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
[email protected]
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
[email protected]
----- Original message -----
From: Thomas Driessen via osgi-dev <[email protected]>
Sent by: [email protected]
To: "OSGi Developer Mail List" <[email protected]>
Cc:
Subject: [osgi-dev] SCR API
Date: Thu, Feb 21, 2019 7:16 AM
Hi,currently I'm debating on a Vaadin FLow issue how to best create components in OSGi programmatically. The answer of my last question on this mailing list regarding this topic was to use scope=PROTOTYPE and then ServiceObjects<Type>#getService(). This is a solution far better than the approach I used before but still has some flaws, resulting in the following question:Is there (or is it planned to create) an API for SCR to programmatically create components at runtime?I think of something like the Apache Felix DependencyManager where I can register services but not components (with refrences and stuff).What I think of would be something like this:scr.createCmp(Class class).setActivateMethod(...).setReferenceField(...).etc...Kind regards,Thomas_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
