public class DataRateLimitedServlet extends HttpServlet
Two implementations are supported:
StandardDataStream impl uses only standard
APIs, but produces more garbage due to the byte[] nature of the API.
JettyDataStream impl uses a Jetty API to write a ByteBuffer
and thus allow the efficient use of file mapped buffers without any
temporary buffer copies (I did tell the JSR that this was a good idea to
have in the standard!).
The data rate is controlled by setting init parameters:
| Constructor and Description |
|---|
DataRateLimitedServlet() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
protected void |
doGet(HttpServletRequest request,
HttpServletResponse response) |
void |
init() |
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, servicegetInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, logpublic void init()
throws ServletException
init in class GenericServletServletExceptionpublic void destroy()
destroy in interface Servletdestroy in class GenericServletprotected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
doGet in class HttpServletServletExceptionIOExceptionCopyright © 1995-2015 Webtide. All Rights Reserved.