public class RequestRateThrottleFilter
extends java.lang.Object
implements javax.servlet.Filter
| Modifier and Type | Field and Description |
|---|---|
private int |
hits |
private static java.lang.String |
HITS |
private int |
period |
private static java.lang.String |
PERIOD |
| Constructor and Description |
|---|
RequestRateThrottleFilter() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Called by the web container to indicate to a filter that it is being
taken out of service.
|
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
Checks to see if the current session has exceeded the allowed number
of requests in the specified time period.
|
void |
init(javax.servlet.FilterConfig filterConfig)
Called by the web container to indicate to a filter that it is being
placed into service.
|
private int hits
private int period
private static final java.lang.String HITS
private static final java.lang.String PERIOD
public void init(javax.servlet.FilterConfig filterConfig)
init in interface javax.servlet.FilterfilterConfig - configuration objectpublic void doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
throws java.io.IOException,
javax.servlet.ServletException
doFilter in interface javax.servlet.Filterrequest - response - chain - java.io.IOExceptionjavax.servlet.ServletExceptionpublic void destroy()
destroy in interface javax.servlet.Filter