Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.util
Class TimerFilter

java.lang.Object
  extended by com.jivesoftware.util.TimerFilter
All Implemented Interfaces:
javax.servlet.Filter

public class TimerFilter
extends java.lang.Object
implements javax.servlet.Filter

A simple filter which records the execution time of the filter. A TimerFilter.Timer object is put in the request as an attribute. This can be used by included servlets or JSPs.


Nested Class Summary
static class TimerFilter.Timer
          A *simple* model of a timer.
 
Field Summary
static java.lang.String DEFAULT_TIMER_ATTRIBUTE
          The default attribute name of the timer object in the request.
 
Constructor Summary
TimerFilter()
           
 
Method Summary
 void destroy()
          Does nothing.
 void doFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain filterChain)
          Creates a Timer object, puts it in the request as an attribute then times the doFilter(..) call.
 void handleTimer(TimerFilter.Timer timer)
          Does nothing in this implementation.
 void init(javax.servlet.FilterConfig filterConfig)
          Sets the timer attribute name to the value of the 'key' init paramter if it was set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TIMER_ATTRIBUTE

public static final java.lang.String DEFAULT_TIMER_ATTRIBUTE
The default attribute name of the timer object in the request.

See Also:
Constant Field Values
Constructor Detail

TimerFilter

public TimerFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig filterConfig)
          throws javax.servlet.ServletException
Sets the timer attribute name to the value of the 'key' init paramter if it was set.

Specified by:
init in interface javax.servlet.Filter
Throws:
javax.servlet.ServletException

doFilter

public void doFilter(javax.servlet.ServletRequest servletRequest,
                     javax.servlet.ServletResponse servletResponse,
                     javax.servlet.FilterChain filterChain)
              throws java.io.IOException,
                     javax.servlet.ServletException
Creates a Timer object, puts it in the request as an attribute then times the doFilter(..) call. Once done, the handleTimer(TimerFilter.Timer) method is called.

Specified by:
doFilter in interface javax.servlet.Filter
Throws:
java.io.IOException
javax.servlet.ServletException

handleTimer

public void handleTimer(TimerFilter.Timer timer)
Does nothing in this implementation. Subclassers can implement this method for additional functionality.

Parameters:
timer - the completed timer.

destroy

public void destroy()
Does nothing.

Specified by:
destroy in interface javax.servlet.Filter

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.