public void invoke(Request request,
Response response,
ValveContext context) throws IOException, ServletException {
long start = System.currentTimeMillis();
// increment active thread count
stats.callIn();
// let the servlet invokation go through
context.invokeNext(request, response);
// decrement active thread count
stats.callOut();
// Update the web context invocation stats
long end = System.currentTimeMillis();
long elapsed = end - start;
String webCtx = request.getContext().getName();
stats.updateStats(webCtx, elapsed);
}
Valve-chain handler method.
This method gets called when the request goes through the Valve-chain. The
activeThreadCount attribute gets incremented/decremented before/after the
servlet invocation. |