Class WebAsyncUtils
- java.lang.Object
- org.springframework.web.context.request.async.WebAsyncUtils
public abstract class WebAsyncUtils extends Object
Utility methods related to processing asynchronous web requests.- Since:
- 3.2
- Author:
- Rossen Stoyanchev, Juergen Hoeller
Field Summary
Fields Modifier and Type Field Description static StringWEB_ASYNC_MANAGER_ATTRIBUTEThe name attribute containing theWebAsyncManager.
Constructor Summary
Constructors Constructor Description WebAsyncUtils()
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AsyncWebRequestcreateAsyncWebRequest(HttpServletRequest request, HttpServletResponse response)Create an AsyncWebRequest instance.static WebAsyncManagergetAsyncManager(ServletRequest servletRequest)Obtain theWebAsyncManagerfor the current request, or if not found, create and associate it with the request.static WebAsyncManagergetAsyncManager(WebRequest webRequest)Obtain theWebAsyncManagerfor the current request, or if not found, create and associate it with the request.
Field Detail
WEB_ASYNC_MANAGER_ATTRIBUTE
public static final String WEB_ASYNC_MANAGER_ATTRIBUTE
The name attribute containing theWebAsyncManager.
Constructor Detail
WebAsyncUtils
public WebAsyncUtils()
Method Detail
getAsyncManager
public static WebAsyncManager getAsyncManager(ServletRequest servletRequest)
Obtain theWebAsyncManagerfor the current request, or if not found, create and associate it with the request.
getAsyncManager
public static WebAsyncManager getAsyncManager(WebRequest webRequest)
Obtain theWebAsyncManagerfor the current request, or if not found, create and associate it with the request.
createAsyncWebRequest
public static AsyncWebRequest createAsyncWebRequest(HttpServletRequest request, HttpServletResponse response)
Create an AsyncWebRequest instance. By default, an instance ofStandardServletAsyncWebRequestgets created.- Parameters:
request- the current requestresponse- the current response- Returns:
- an AsyncWebRequest instance (never
null)