Class ServletHttpHandlerAdapter
java.lang.Object
org.springframework.http.server.reactive.ServletHttpHandlerAdapter
- All Implemented Interfaces:
jakarta.servlet.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(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.AsyncContext context) protected org.springframework.http.server.reactive.ServletServerHttpResponsecreateResponse(jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.AsyncContext context, org.springframework.http.server.reactive.ServletServerHttpRequest request) voiddestroy()intReturn the configured input buffer size.@Nullable jakarta.servlet.ServletConfigReturn the Servlet path under which the Servlet is deployed by checking the Servlet registration frominit(ServletConfig).voidinit(jakarta.servlet.ServletConfig config) voidservice(jakarta.servlet.ServletRequest request, jakarta.servlet.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
public void init(jakarta.servlet.ServletConfig config) - Specified by:
initin interfacejakarta.servlet.Servlet
-
service
public void service(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response) throws jakarta.servlet.ServletException, IOException - Specified by:
servicein interfacejakarta.servlet.Servlet- Throws:
jakarta.servlet.ServletExceptionIOException
-
createRequest
protected org.springframework.http.server.reactive.ServletServerHttpRequest createRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.AsyncContext context) throws IOException, URISyntaxException - Throws:
IOExceptionURISyntaxException
-
createResponse
protected org.springframework.http.server.reactive.ServletServerHttpResponse createResponse(jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.AsyncContext context, org.springframework.http.server.reactive.ServletServerHttpRequest request) throws IOException - Throws:
IOException
-
getServletInfo
- Specified by:
getServletInfoin interfacejakarta.servlet.Servlet
-
getServletConfig
- Specified by:
getServletConfigin interfacejakarta.servlet.Servlet
-
destroy
public void destroy()- Specified by:
destroyin interfacejakarta.servlet.Servlet
-