public void handle(String path, Request request, HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException, ServletException
{
_dispatchedStats.increment();
final long start;
HttpChannelState state = request.getHttpChannelState();
if (state.isInitial())
{
// new request
_requestStats.increment();
start = request.getTimeStamp();
}
else
{
// resumed request
start = System.currentTimeMillis();
_asyncDispatches.incrementAndGet();
}
try
{
super.handle(path, request, httpRequest, httpResponse);
}
finally
{
final long now = System.currentTimeMillis();
final long dispatched=now-start;
_dispatchedStats.decrement();
_dispatchedTimeStats.set(dispatched);
if (state.isSuspended())
{
if (state.isInitial())
{
state.addListener(_onCompletion);
_asyncWaitStats.increment();
}
}
else if (state.isInitial())
{
long d=_requestStats.decrement();
_requestTimeStats.set(dispatched);
updateResponse(request);