Exactly, I don't have the code here, but it will be like a more generic big brother of the current implementation. I'm not sure if you can extend it (using inheritance of the current code) to adapt it to JEE environments, but we can work out on that.
Cheers