I’m not quite sure what this question means, but the most obvious 
interpretation is “how should I deal with registering a service that is a 
fluent builder?”. 

The JAX-RS Whiteboard does this with the ClientBuilder service 
<https://osgi.org/specification/osgi.cmpn/7.0.0/service.jaxrs.html#d0e134114>. 
And the way in which it works is highly related to the rules of the builder. In 
the case of the ClientBuilder the builder returns this not a copy, therefore it 
is not possible for multiple components to share a single builder service. 
Therefore the builder must be registered and used as a prototype scope service.

If (and only if) your builder creates copies of itself each time a method on it 
is called then it is safe to use it as a singleton or bundle scoped service. 
This situation is comparatively rare.

I hope this helps.

Tim

> On 29 Jan 2019, at 16:39, Alain Picard via osgi-dev <osgi-dev@mail.osgi.org> 
> wrote:
> 
> I am curious if there is a prescribed or suggested approach to use fluent 
> builder in conjunction with Fluent builders?
> 
> Cheers,
> Alain
> 
> 
> _______________________________________________
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev

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

Reply via email to