|
Spring Framework | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AsyncHandlerInterceptor
Extends HanderInterceptor
with lifecycle methods specific to async
request processing.
This is the sequence of events on the main thread in an async scenario:
#preHandle(WebRequest)
#getAsyncCallable(WebRequest)
#postHandleAsyncStarted(WebRequest)
This is the sequence of events on the async thread:
Callable.call()
(the Callable
returned by getAsyncCallable
)
#postHandle(WebRequest, org.springframework.ui.ModelMap)
#afterCompletion(WebRequest, Exception)
Method Summary | |
---|---|
AbstractDelegatingCallable |
getAsyncCallable(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler)
Invoked after #preHandle(WebRequest) and before
the handler is executed. |
void |
postHandleAsyncStarted(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler)
Invoked after the execution of a handler if the handler started async processing instead of handling the request. |
Methods inherited from interface org.springframework.web.servlet.HandlerInterceptor |
---|
afterCompletion, postHandle, preHandle |
Method Detail |
---|
AbstractDelegatingCallable getAsyncCallable(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object handler)
#preHandle(WebRequest)
and before
the handler is executed. The returned Callable
is used only if
handler execution leads to teh start of async processing. It is invoked
the async thread before the request is handled fro.
Implementations can use this Callable
to initialize
ThreadLocal attributes on the async thread.
request
- current HTTP requestresponse
- current HTTP responsehandler
- chosen handler to execute, for type and/or instance examination
Callable
instance or null
void postHandleAsyncStarted(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object handler)
#postHandle(WebRequest, org.springframework.ui.ModelMap)
. The
postHandle
method is invoked after the request is handled
in the async thread.
Implementations of this method can ensure ThreadLocal attributes bound to the main thread are cleared and also prepare for binding them to the async thread.
request
- current HTTP requestresponse
- current HTTP responsehandler
- chosen handler to execute, for type and/or instance examination
|
Spring Framework | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |