com.caucho.filters
Class ThrottleFilter

java.lang.Object
  extended by com.caucho.filters.ThrottleFilter
All Implemented Interfaces:
Filter

public class ThrottleFilter
extends java.lang.Object
implements Filter

Throttles the filter to only a limited number of requests.


Constructor Summary
ThrottleFilter()
           
 
Method Summary
 void destroy()
          Any cleanup for the filter.
 void doFilter(ServletRequest request, ServletResponse response, FilterChain nextFilter)
          doFilter performs the actual work of a filter, either modifying the request or the response.
 void init(FilterConfig config)
          Initialize the filter.
 void setMaxConcurrentRequests(int max)
          Sets the maximum number of concurrent requests for a single IP.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThrottleFilter

public ThrottleFilter()
Method Detail

setMaxConcurrentRequests

public void setMaxConcurrentRequests(int max)
Sets the maximum number of concurrent requests for a single IP.


init

public void init(FilterConfig config)
          throws ServletException
Description copied from interface: Filter
Initialize the filter.

Specified by:
init in interface Filter
Throws:
ServletException

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response,
                     FilterChain nextFilter)
              throws ServletException,
                     java.io.IOException
Description copied from interface: Filter
doFilter performs the actual work of a filter, either modifying the request or the response. It will typically call the chain.doFilter() to invoke the next filter in the chain.

Specified by:
doFilter in interface Filter
Parameters:
request - the servlet request
response - the servlet response
nextFilter - the next filter in the chain
Throws:
ServletException
java.io.IOException

destroy

public void destroy()
Any cleanup for the filter.

Specified by:
destroy in interface Filter