/** * Copyright (C) 2008-2010, Squale Project - http://www.squale.org * * This file is part of Squale. * * Squale is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 3 of the * License, or any later version. * * Squale is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Squale. If not, see <http://www.gnu.org/licenses/>. */ package org.squale.welcom.struts.filter; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * @author M327837 Pour changer le mod�le de ce commentaire de type g�n�r�, allez � : * Fen�tre>Pr�f�rences>Java>G�n�ration de code>Code et commentaires */ public class WTimerFilter implements Filter { /** logger */ private static Log log = LogFactory.getLog( WTimerFilter.class ); /** Config */ private FilterConfig config; /** * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, * javax.servlet.FilterChain) */ public void doFilter( final ServletRequest request, final ServletResponse response, final FilterChain chain ) throws IOException, ServletException { final long startTime = System.currentTimeMillis(); chain.doFilter( request, response ); final long stopTime = System.currentTimeMillis(); log.debug( "Time to execute request: " + ( stopTime - startTime ) + " milliseconds (" + ( (HttpServletRequest) request ).getRequestURI() + ")" ); } /** * @see javax.servlet.Filter#init(javax.servlet.FilterConfig) */ public void init( final FilterConfig arg0 ) throws ServletException { config = arg0; } /** * @see javax.servlet.Filter#destroy() */ public void destroy() { } }