public class DataRateLimitedServlet
extends javax.servlet.http.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 | Description |
|---|---|
DataRateLimitedServlet() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
destroy() |
|
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
|
void |
init() |
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, logpublic void init()
throws javax.servlet.ServletException
init in class javax.servlet.GenericServletjavax.servlet.ServletExceptionpublic void destroy()
destroy in class javax.servlet.GenericServletprotected void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
doGet in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionjava.io.IOExceptionCopyright © 1995–2018 Webtide. All rights reserved.