Hi, 

If you are using Component Factories then you are not also using Managed 
Service Factories, the two are simply not possible to use together.

A component factory lets you supply custom configuration to programmatically 
create multiple instances of a component. These are combined with any static 
properties and any configuration provided to the *singleton* component factory 
via its pid.

Specifying a *required* configuration policy lets you use the configuration pid 
of a DS component as a factory pid. This, in turn, lets you use factory 
configurations to create multiple configured component instances at runtime. 
Importantly these instances are bound to the lifecycle of the factory 
configuration that they correspond to.

As you can see it is simply not possible to mix the two models as they have 
fundamentally different lifecycles. Component Factories are programmatic, 
Factory Configurations (Managed Service Factories) are declarative and bound to 
the lifecycle of the configuration object.

In general you probably don’t want to use a component factory with DS. Factory 
configurations are much less invasive to your code, and much simpler to manage.

Best Regards,

Tim

> On 25 Mar 2019, at 14:32, Matthias Leinweber 
> <matthias.leinwe...@ida-analytics.de> wrote:
> 
> Hello Karaf Team, 
> 
> i don't know if it is the correct mailing list, because its just possibly 
> related to karaf specific implementation.
> 
> I try to configure multiple services which are created by a component factory 
> (newInstance). But i don't find a way how i can give a unique pid to a 
> created service instance. 
> 
> Did i understand something wrong an do i have to use ManagedServiceFactories?
> 
> regards,
> Matthias
> 
> Matthias Leinweber 
> Managing Director & Chief Analytics Officer
>  <Outlook-1491765456.png>
> Intelligent Data Analytics GmbH & Co. KG 
>  
> c/o TechQuartier 
> Platz der Einheit 2 
> 60327 Frankfurt 
> Mobil: 0151/73006079 
> Telefon: 06421/4805274  
> Telefax: 06421/4805275  
> E-Mail: matthias.leinweber 
> <mailto:matthias.leinwe...@ida-analytics.de>@ida-analytics.de 
> <mailto:matthias.leinwe...@ida-analytics.de> 
> Internet: www.ida-analytics.de <http://www.ida-analytics.de/> 
>  
> Unternehmenssitz: Frankfurt am Main | Handelsregister beim Amtsgericht: 
> Frankfurt am Main, Registernummer: HRA 49357 | USt. ID-Nr.: DE310205810 | 
> Finanzamt: Frankfurt am Main 
> Persönlich haftende Gesellschafterin: IDA Intelligent Data Analytics GmbH | 
> Sitz: Frankfurt am Main | Handelsregister beim Amtsgericht: Frankfurt am Main 
> | Handelsregister-Nummer: HRB 106805 | Geschäftsführer: Mohamed Ayadi, Nils 
> Björn Krugmann, Dipl.-Inf. Matthias Leinweber, Dipl.-Inf. Marc Seidemann 
>   
> If you are not the addressee, please inform us immediately that you have 
> received this e-mail by mistake, and delete it. We thank you for your 
> support. 
> 
> 
>  
> Besuchen Sie uns vom 01.-05. April auf der HANNOVER MESSE. Sie finden uns auf 
> dem hessischen Gemeinschaftsstand in Halle 6 Stand A24. Weitere Informationen 
> finden Sie hier. <https://www.digitalstrategie-hessen.de/hannovermesse>

Reply via email to