Class ServletHttpHandlerAdapter
java.lang.Object
org.springframework.http.server.reactive.ServletHttpHandlerAdapter
- All Implemented Interfaces:
Servlet
- Direct Known Subclasses:
TomcatHttpHandlerAdapter
Adapt
HttpHandler to an HttpServlet using Servlet Async support
and Servlet non-blocking I/O.- Since:
- 5.0
- Author:
- Arjen Poutsma, Rossen Stoyanchev
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.http.server.reactive.ServletServerHttpRequestcreateRequest(HttpServletRequest request, AsyncContext context) protected org.springframework.http.server.reactive.ServletServerHttpResponsecreateResponse(HttpServletResponse response, AsyncContext context, org.springframework.http.server.reactive.ServletServerHttpRequest request) voiddestroy()intReturn the configured input buffer size.Return the Servlet path under which the Servlet is deployed by checking the Servlet registration frominit(ServletConfig).voidinit(ServletConfig config) voidservice(ServletRequest request, ServletResponse response) voidsetBufferSize(int bufferSize) Set the size of the input buffer used for reading in bytes.voidsetDataBufferFactory(DataBufferFactory dataBufferFactory)
-
Constructor Details
-
ServletHttpHandlerAdapter
-
-
Method Details
-
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).- Returns:
- 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
-
getDataBufferFactory
-
init
-
service
public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException - Specified by:
servicein interfaceServlet- Throws:
ServletExceptionIOException
-
createRequest
protected org.springframework.http.server.reactive.ServletServerHttpRequest createRequest(HttpServletRequest request, AsyncContext context) throws IOException, URISyntaxException - Throws:
IOExceptionURISyntaxException
-
createResponse
protected org.springframework.http.server.reactive.ServletServerHttpResponse createResponse(HttpServletResponse response, AsyncContext context, org.springframework.http.server.reactive.ServletServerHttpRequest request) throws IOException - Throws:
IOException
-
getServletInfo
- Specified by:
getServletInfoin interfaceServlet
-
getServletConfig
- Specified by:
getServletConfigin interfaceServlet
-
destroy
public void destroy()
-