update javadoc for DoSFilter

This commit is contained in:
Greg Wilkins 2014-12-04 01:01:18 +11:00
parent a3b89897d3
commit 904b6a113f
2 changed files with 8 additions and 2 deletions

View File

@ -31,9 +31,11 @@ import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import javax.servlet.AsyncContext; import javax.servlet.AsyncContext;
import javax.servlet.AsyncEvent; import javax.servlet.AsyncEvent;
import javax.servlet.AsyncListener; import javax.servlet.AsyncListener;
import javax.servlet.DispatcherType;
import javax.servlet.Filter; import javax.servlet.Filter;
import javax.servlet.FilterChain; import javax.servlet.FilterChain;
import javax.servlet.FilterConfig; import javax.servlet.FilterConfig;
@ -126,6 +128,10 @@ import org.eclipse.jetty.util.thread.Scheduler;
* manage the configuration of the filter.</dd> * manage the configuration of the filter.</dd>
* </dl> * </dl>
* </p> * </p>
* <p>
* This filter should be configured for {@link DispatcherType#REQUEST} and {@link DispatcherType#ASYNC} and with
* <code>&lt;async-supported&gt;true&lt;/async-supported&gt;</code>.
* </p>
*/ */
@ManagedObject("limits exposure to abuse from request flooding, whether malicious, or as a result of a misconfigured client") @ManagedObject("limits exposure to abuse from request flooding, whether malicious, or as a result of a misconfigured client")
public class DoSFilter implements Filter public class DoSFilter implements Filter

View File

@ -69,7 +69,7 @@ public abstract class AbstractDoSFilterTest
_tester.getContext().addServlet(TestServlet.class, "/*"); _tester.getContext().addServlet(TestServlet.class, "/*");
_dosFilter = _tester.getContext().addFilter(filter, "/dos/*", EnumSet.allOf(DispatcherType.class)); _dosFilter = _tester.getContext().addFilter(filter, "/dos/*", EnumSet.of(DispatcherType.REQUEST,DispatcherType.ASYNC));
_dosFilter.setInitParameter("maxRequestsPerSec", "4"); _dosFilter.setInitParameter("maxRequestsPerSec", "4");
_dosFilter.setInitParameter("delayMs", "200"); _dosFilter.setInitParameter("delayMs", "200");
_dosFilter.setInitParameter("throttledRequests", "1"); _dosFilter.setInitParameter("throttledRequests", "1");
@ -78,7 +78,7 @@ public abstract class AbstractDoSFilterTest
_dosFilter.setInitParameter("remotePort", "false"); _dosFilter.setInitParameter("remotePort", "false");
_dosFilter.setInitParameter("insertHeaders", "true"); _dosFilter.setInitParameter("insertHeaders", "true");
_timeoutFilter = _tester.getContext().addFilter(filter, "/timeout/*", EnumSet.allOf(DispatcherType.class)); _timeoutFilter = _tester.getContext().addFilter(filter, "/timeout/*", EnumSet.of(DispatcherType.REQUEST,DispatcherType.ASYNC));
_timeoutFilter.setInitParameter("maxRequestsPerSec", "4"); _timeoutFilter.setInitParameter("maxRequestsPerSec", "4");
_timeoutFilter.setInitParameter("delayMs", "200"); _timeoutFilter.setInitParameter("delayMs", "200");
_timeoutFilter.setInitParameter("throttledRequests", "1"); _timeoutFilter.setInitParameter("throttledRequests", "1");