Queued process from jsp

Hi,

In my jsp(or servlet),

I took the parameters and by using Runtime's exec() method, I call a windows process to do some work.

As the jsp runs in the server, a lot of concurrent requests can be made to jsp.

But the windows' exe can not run concurrently. What I must do is, to take the requests, if the exe is available run the exe, if it is not, wait for its work to be completed then run the exe. Thus put the request in the queue.

It is not important how long the clients wait.

I think I must use some other technologies inside the jsp, like

JMS or

concurrent porgramming or

threads or

something else.....

What is it?

Does anyone has any idea?

thanks

[742 byte] By [esesa] at [2007-11-26 16:33:16]
# 1

Try putting the Runtime exec call in a seperate singleton class and use a synchronized method to call it. This should allow only one thread to access the method at a time and internally queue up th eother threads. You'll need to do some good load testng to make sure it will stand up to the expected peak load.

tolmanka at 2007-7-8 22:57:58 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
That really solved my problem.Thanks a lot
esesa at 2007-7-8 22:57:58 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...