Hi,

My problem is that I need a pool manager to control the number of instances of 
a 3rd party library that are loaded to service the requests. Each request needs 
an instance of the 3rd party library. 

So let's say I can service 10 requests at a time. I need to make the other 
requests wait while an instance of the library is freed.

>From what I've been reading, this can't be easily accomplished. If I use a 
thread pool manager to manage the requests, a response will be automatically 
returned when the handle method returns.

So what I'm trying to do is to block the Resource that handles each request, in 
the handleGet method, so it won't return until the request has been serviced. 

The problem now is that when calling wait() inside the handleGet method, the 
other requests are not processed until after that handleGet returns.

As I understand from the documentation, each Resource has it's own thread, 
right? So shouldn't the other requests be handled while the first one is 
waiting?

Inside handleGet I'm using: 

synchronized (this)
{
   this.wait();
}


Thanks!



Reply via email to