On 11/18/2016 2:02 PM, Scott Lewis wrote:
On 11/18/2016 1:58 PM, Tim Ward wrote:
That sounds a lot like the DS ComponentFactory use case to me. You supply properties to the factory and it spits out a configured instance for you to use.

Yeah I agree ComponentFactory seems relevant, and I have played around with it for this use case.


Just to confirm, I assume that the standard multiton pattern using factory configurations doesn't help you as the components are stateful and need to be created on demand?

Question: If I use a component factory as suggested above to create a component instance, is there a straightforward way to associate every newInstance with a separate/new configuration? My first thought was to use a factory configuration, but it says this in 112.7

A factory configuration must not be used if the component is a factory component. This is because SCR is not free to create component configurations as necessary to support multiple Configurations. When SCR detects this condition, it must log an error message with the Log Service, if present, and ignore the component description.

Thanks,

Scott

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

Reply via email to