Interface AsyncWebRequestInterceptor
- All Superinterfaces:
WebRequestInterceptor
- All Known Implementing Classes:
Log4jNestedDiagnosticContextInterceptor,OpenEntityManagerInViewInterceptor,OpenSessionInViewInterceptor,OpenSessionInViewInterceptor,OpenSessionInViewInterceptor
public interface AsyncWebRequestInterceptor extends WebRequestInterceptor
ExtendsWebRequestInterceptorwith a callback method invoked during asynchronous request handling.When a handler starts asynchronous request handling, the DispatcherServlet exits without invoking
postHandleandafterCompletion, as it normally does, since the results of request handling (e.g. ModelAndView) are not available in the current thread and handling is not yet complete. In such scenarios, theafterConcurrentHandlingStarted(WebRequest)method is invoked instead allowing implementations to perform tasks such as cleaning up thread bound attributes.When asynchronous handling completes, the request is dispatched to the container for further processing. At this stage the DispatcherServlet invokes
preHandle,postHandleandafterCompletionas usual.- Since:
- 3.2
- Author:
- Rossen Stoyanchev
- See Also:
WebAsyncManager
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidafterConcurrentHandlingStarted(WebRequest request)Called instead ofpostHandleandafterCompletion, when the the handler started handling the request concurrently.Methods inherited from interface org.springframework.web.context.request.WebRequestInterceptor
afterCompletion, postHandle, preHandle
Method Detail
afterConcurrentHandlingStarted
void afterConcurrentHandlingStarted(WebRequest request)
Called instead ofpostHandleandafterCompletion, when the the handler started handling the request concurrently.- Parameters:
request- the current request