You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by Arnaud Mergey <a_...@yahoo.fr> on 2020/08/06 15:27:14 UTC

Registering a prototype scoped service with aries blueprint

Hello,I am trying to register a service with prototype scope with Aries Blueprint. 
It seems not supported directly in Blueprint specs, but I thought registering a org.osgi.framework.PrototypeServiceFactory would have worked but it is not. It seems Aries itself is wrapping services in org.apache.aries.blueprint.container.ServiceRecipe.TriggerServiceFactory before registering it in the osgi runtime, this why my PrototypeServiceFactory is not considered as Protoype. 
Is is something that is supposed to work, so I should fill a bug ? or not ?Best,Arnaud




Re: Registering a prototype scoped service with aries blueprint

Posted by Arnaud Mergey <a_...@yahoo.fr>.
 Hello,
Currently I need to mix declarative service and blueprint to be able to register a service with prototype scope.I would prefer to declare all in blueprint and remove declarative service usage
Could it be something supported by Aries ?
Best,Arnaud    Le jeudi 6 août 2020, 17:27:24 UTC+2, Arnaud Mergey <a_...@yahoo.fr> a écrit :  
 
 Hello,I am trying to register a service with prototype scope with Aries Blueprint. 
It seems not supported directly in Blueprint specs, but I thought registering a org.osgi.framework.PrototypeServiceFactory would have worked but it is not. It seems Aries itself is wrapping services in org.apache.aries.blueprint.container.ServiceRecipe.TriggerServiceFactory before registering it in the osgi runtime, this why my PrototypeServiceFactory is not considered as Protoype. 
Is is something that is supposed to work, so I should fill a bug ? or not ?Best,Arnaud



  

Re: Registering a prototype scoped service with aries blueprint

Posted by Arnaud Mergey <a_...@yahoo.fr>.
 Hello,
Looking at the code, it seems a way to achieve this could be to add some scope attribute in blueprint-ext xsd and then have 2 version of TriggerServiceFactory on implementing ServiceFactory and other implementing PrototypeServiceFactory. 
Is it worth spending some time to propose a PR for this ? Arnaud    Le jeudi 6 août 2020 à 17:27:24 UTC+2, Arnaud Mergey <a_...@yahoo.fr> a écrit :  
 
 Hello,I am trying to register a service with prototype scope with Aries Blueprint. 
It seems not supported directly in Blueprint specs, but I thought registering a org.osgi.framework.PrototypeServiceFactory would have worked but it is not. It seems Aries itself is wrapping services in org.apache.aries.blueprint.container.ServiceRecipe.TriggerServiceFactory before registering it in the osgi runtime, this why my PrototypeServiceFactory is not considered as Protoype. 
Is is something that is supposed to work, so I should fill a bug ? or not ?Best,Arnaud