About your second question:
void setTimeout(long timeout)
can throw (un-checked) IllegalStateException, when someone is setting a timeout on a AsyncContext object, which already FINISHED its work.
Have a look here:
last line of code should throw an exception
OK, I must admit, my code sample is very primitive, but I'm too lazy to write now multi-class example with async requests running in separate threads
And exactly under such conditions (multi-threaded
servlet processing) you have not so bad chance to try working with object, which already finished its work (life-cycle).
I hope, you get the idea: once AsyncContext is recycled you cant use it anymore.
BTW, this is true not only about setTimeout(), but also for nearly all other methods in AsyncContext interface.
And one more hint: just look into the source code of some open-source implementation. I've just done that with "tomcat 7.0"