Here\'s the scenario: I have a multi threaded java web application which is running inside a servlet container. The application is deployed multiple times inside the servlet
Would you be able to employ the use of Semaphore to control access as one at time within the application?
To quote the API "Semaphores are often used to restrict the number of threads than can access some (physical or logical) resources"
Whilst that API might remain container specific, the concept of a distributed Semaphore should be achievable, possibly with JGroups.
A cursory search on Google for 'distributed java semaphore' turned up Jukebox which looks like it could address the above