Is there a way to make a block of code threadsafe so that even if the requests are coming from two different JVMs altogether (where the EARs are deployed having the same code) they do not access the code in parallel?
Separate JVMs would of course have separate object instances and separate Threads so this gets tricky. Probably some outside entity will have to be involved, say a database or a file representing a "token" which both JVMs can see.
Exactly what is the problem you are trying to solve?
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Achieving threadsafe behavior for threads coming from two different JVMs