So the best way I thought of explaining it would be with examples.
When publishing service X, it is needed to register one instance of it. That same instance answers for as many clients call it.
I was wondering if there is a way to instantiate many instances of it on demand. Like client c1 asks for service X under instance x1, client c2 communicates with instance x2, and after processing each instance is destroyed.
As it works with web servers. Each client method call would be a request, and after it responses that request is destroyed.
I saw some answers about multiple references but I wasn't quite sure if they were all the same question I have.
Thankyou
OSGi currently supports ServiceFactory which allows the provider to create a unique service instance for each consumer bundle. This may be sufficient for your needs
But it does not allow the provider to provide a unique service instance for each request for a service within a bundle. I am working on a proposal for R6 to allow the creation of unique service instances for each request. Hopefully it will be accepted into the R6 spec.