类 ServletHttpHandlerAdapter
java.lang.Object
cn.taketoday.http.server.reactive.ServletHttpHandlerAdapter
- 所有已实现的接口:
Servlet
Adapt
HttpHandler to an HttpServlet using Servlet Async support
and Servlet 3.1 non-blocking I/O.- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma, Rossen Stoyanchev
-
嵌套类概要
嵌套类修饰符和类型类说明private static classprivate static classAsyncListener to complete theAsyncContextin case of error or timeout notifications from the container -
字段概要
字段修饰符和类型字段说明private intprivate cn.taketoday.core.io.buffer.DataBufferFactoryprivate static final intprivate final HttpHandlerprivate static final cn.taketoday.logging.Loggerprivate Stringprivate static final String -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected ServletServerHttpRequestcreateRequest(HttpServletRequest request, AsyncContext context) protected ServletServerHttpResponsecreateResponse(HttpServletResponse response, AsyncContext context, ServletServerHttpRequest request) voiddestroy()intReturn the configured input buffer size.cn.taketoday.core.io.buffer.DataBufferFactoryReturn the Servlet path under which the Servlet is deployed by checking the Servlet registration frominit(ServletConfig).private StringgetServletPath(ServletConfig config) voidinit(ServletConfig config) private static voidrunIfAsyncNotComplete(AsyncContext asyncContext, AtomicBoolean isCompleted, Runnable task) voidservice(ServletRequest request, ServletResponse response) voidsetBufferSize(int bufferSize) Set the size of the input buffer used for reading in bytes.voidsetDataBufferFactory(cn.taketoday.core.io.buffer.DataBufferFactory dataBufferFactory)
-
字段详细资料
-
logger
private static final cn.taketoday.logging.Logger logger -
DEFAULT_BUFFER_SIZE
private static final int DEFAULT_BUFFER_SIZE- 另请参阅:
-
WRITE_ERROR_ATTRIBUTE_NAME
-
httpHandler
-
bufferSize
private int bufferSize -
dataBufferFactory
private cn.taketoday.core.io.buffer.DataBufferFactory dataBufferFactory -
servletPath
-
-
构造器详细资料
-
ServletHttpHandlerAdapter
-
-
方法详细资料
-
setBufferSize
public void setBufferSize(int bufferSize) Set the size of the input buffer used for reading in bytes.By default this is set to 8192.
-
getBufferSize
public int getBufferSize()Return the configured input buffer size. -
getServletPath
Return the Servlet path under which the Servlet is deployed by checking the Servlet registration frominit(ServletConfig).- 返回:
- the path, or an empty string if the Servlet is deployed without
a prefix (i.e. "/" or "/*"), or
nullif this method is invoked before theinit(ServletConfig)Servlet container callback.
-
setDataBufferFactory
public void setDataBufferFactory(cn.taketoday.core.io.buffer.DataBufferFactory dataBufferFactory) -
getDataBufferFactory
public cn.taketoday.core.io.buffer.DataBufferFactory getDataBufferFactory() -
init
-
getServletPath
-
service
public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException - 指定者:
service在接口中Servlet- 抛出:
ServletExceptionIOException
-
createRequest
protected ServletServerHttpRequest createRequest(HttpServletRequest request, AsyncContext context) throws IOException, URISyntaxException -
createResponse
protected ServletServerHttpResponse createResponse(HttpServletResponse response, AsyncContext context, ServletServerHttpRequest request) throws IOException - 抛出:
IOException
-
getServletInfo
- 指定者:
getServletInfo在接口中Servlet
-
getServletConfig
- 指定者:
getServletConfig在接口中Servlet
-
destroy
public void destroy() -
runIfAsyncNotComplete
private static void runIfAsyncNotComplete(AsyncContext asyncContext, AtomicBoolean isCompleted, Runnable task)
-