|Multiple OSGI Service instance [message #733762]
||Wed, 05 October 2011 15:09
| Benoit Lafleche
Registered: April 2011
In VIRGO, I have a bundle which is performing some big and long tasks. All the possible tasks are defined via an Interface and the implementor is defined as an OSGI service. This service is now deployed on VIRGO.
The clients are an Eclipse RCP application and communicate to VIRGO via the Spring HttpInvoker feature.
I have a web bundle which accept the request from the Spring Http Invoker and to process the request, just redirect it to the OSGI service. For now, when more than one client is trying to perform the big task, I have a concurrency problem. What I would like is that each user session gets its own instance of the OSGI service.
Is there a way to get a different OSGI service for each user web session or this is out of the definition of an OSGI service?
Presently, we could defined a different OSGI service instance by specifying the scope="bundle" in the bean definition, but the service would be different for each client bundle! In my case, I have only one web client bundle which means the same service.
I'm trying to see if I could do something with VIRGO and Spring without having to code any pooling mechanism inside my service.
I'm still not too sure if versus using an OSGI service, I should just export the class that was providing the service, and then the web bundle will create itself a new instance of the service on demand?
Of course, the way my service is presently written and when I deployed it within my FAT eclipse RCP application, then the OSGI service is working as expected!
Thanks a lot if you have any comments or suggestions!
Powered by FUDForum
. Page generated in 0.03576 seconds