Class ServletHttpHandlerAdapter
java.lang.Object
org.springframework.http.server.reactive.ServletHttpHandlerAdapter
- All Implemented Interfaces:
Servlet
- Direct Known Subclasses:
JettyHttpHandlerAdapter
,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
-
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.http.server.reactive.ServletServerHttpRequest
createRequest
(HttpServletRequest request, AsyncContext context) protected org.springframework.http.server.reactive.ServletServerHttpResponse
createResponse
(HttpServletResponse response, AsyncContext context, org.springframework.http.server.reactive.ServletServerHttpRequest request) void
destroy()
int
Return the configured input buffer size.Return the Servlet path under which the Servlet is deployed by checking the Servlet registration frominit(ServletConfig)
.void
init
(ServletConfig config) void
service
(ServletRequest request, ServletResponse response) void
setBufferSize
(int bufferSize) Set the size of the input buffer used for reading in bytes.void
setDataBufferFactory
(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
null
if 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:
service
in interfaceServlet
- Throws:
ServletException
IOException
-
createRequest
protected org.springframework.http.server.reactive.ServletServerHttpRequest createRequest(HttpServletRequest request, AsyncContext context) throws IOException, URISyntaxException - Throws:
IOException
URISyntaxException
-
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:
getServletInfo
in interfaceServlet
-
getServletConfig
- Specified by:
getServletConfig
in interfaceServlet
-
destroy
public void destroy()
-