I’m doing some code conversion to J2EE compatibilty, and some classes require that they be executed with the guarantee only one outstanding thread is ever accessing them. They can process incoming requests asynchronously, by queuiing them up. They use a very fine-grained asynch exec model, so that all this happens efficiently (think of DMA…).
This is problematic, since J2EE doesn’t (IIRC) allow single-thread-only access to any servlet, which means I will have to jump through hoops within the servlet to try and guarantee it - throw exceptions in constructors to try and prevent the things being created - etc. I’ve never tried to do this in J2EE that I can remember, so maybe there’s some simple way I’m just ignorant of.
These classes work fine in the grexengine (which just has a flag to enable this for a given component!), but rather than have to port or rewrite the code to make it also execute under J2EE I’d like to find some clean way of making it work. Any ideas?