In Spring lingo, that would be a prototype scoped bean.
Are you using spring-dm or OSGi blueprint?
Thanks a lot for your answer mr. Davsclaus, i'm using OSGi blueprint. Is it possible to achieve this behaviour with the OSGi blueprint??
Thanks in advance
Yes I think that is doable, but the documentation at Apache Aries is not giving any examples, but stating its possible. See
But it seems this article shows how to
Thanks a lot for the answer mr. Davsclaus, I really appreciate it, I have changed my service definition to:
However, i'm getting the same results :-S , Every time I get a service object on my clients, i always get the same instance.
I'm sorry if this is a basic/dumb question but, are we supposed to handle concurrency on every method within every bundle that we expose as a service on the esb given that we always get the same instance?? , or, am I approaching the problem in a wrong way?
Thanks a lot in advance.
I just read this paragraph on the Osgi in action book:
"The framework caches factory-created service instances, so a bundle requesting the
same service twice receives the same instance. This cached instance is removed only
when the bundle has completely finished with a service (that is, the number of calls to
get it match the calls to unget it), when the bundle has stopped, or when the service
factory is unregistered."
Seems like the whole OSGI philosophy mandates this behaviour. Doesn't this hinder services scalability???. Anyway, i think for now i will export the classes I need and instantiate them on my consumers.
Thanks a lot mr. Davsclaus for the help.