ActivityLogFilter.java :  » Project-Management » XPlanner-0.7b7 » com » technoetic » xplanner » filters » Java Open Source

Java Open Source » Project Management » XPlanner 0.7b7 
XPlanner 0.7b7 » com » technoetic » xplanner » filters » ActivityLogFilter.java
/*
 * Copyright (c) 2006 Your Corporation. All Rights Reserved.
 */
package com.technoetic.xplanner.filters;

import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.FilterChain;
import org.apache.log4j.Logger;
import com.technoetic.xplanner.util.LogUtil;


public class ActivityLogFilter implements Filter {

   public static final Logger LOG = LogUtil.getLogger();

   //TODO: Once we migrate to 1.5, use String.format to extract the logging pattern into the web.xml filter init param.

   public void init(FilterConfig config) throws ServletException {
   }

   public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain)
         throws IOException, ServletException {

      ActivityLogFilterHelper helper = new ActivityLogFilterHelper();
      helper.doHelperSetUp(request);

      LOG.info(helper.getStartLogRecord());

      filterChain.doFilter(request, response);

      LOG.info(helper.getEndLogRecord());

   }

   public void destroy() {
   }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.