Description
I have a simple test sevlet with asyncSupported = true.
In the service() method it is first checked whether it is an initial invokation (request.getAttribute(ASYNC_STARTED) == null).
If it is, startAsync() is invoked and a timer started wich calls asyncContext.dispatch() for several times.
After that we get back to service() method, which this time sees that async has been started, sends some data to client (from request attribute), and starts async context again (if not told not to do so, via request attribute).
The listener just logs all the events.
The expected behavior is that the async context gets (re)"started" several times, client receives several portions of data and after that the asyncContext gets "complete".
In tomcat it works as expected. A few lines from tomcat log: https://gist.github.com/1408639
And in jboss the async context gets "complete" just after the first portion sent and startAsync() is called for the second time (and after the "start" event sent to listener).
Log: https://gist.github.com/1408645