Search in sources :

Example 1 with MetricsHandler

use of io.undertow.server.handlers.MetricsHandler in project undertow by undertow-io.

the class MetricsChainHandler method handleRequest.

@Override
public void handleRequest(final HttpServerExchange exchange) throws Exception {
    ServletRequestContext context = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
    ServletInfo servletInfo = context.getCurrentServlet().getManagedServlet().getServletInfo();
    MetricsHandler handler = servletHandlers.get(servletInfo.getName());
    if (handler != null) {
        handler.handleRequest(exchange);
    } else {
        next.handleRequest(exchange);
    }
}
Also used : ServletInfo(io.undertow.servlet.api.ServletInfo) MetricsHandler(io.undertow.server.handlers.MetricsHandler) ServletRequestContext(io.undertow.servlet.handlers.ServletRequestContext)

Aggregations

MetricsHandler (io.undertow.server.handlers.MetricsHandler)1 ServletInfo (io.undertow.servlet.api.ServletInfo)1 ServletRequestContext (io.undertow.servlet.handlers.ServletRequestContext)1