public class TimeoutCallableProcessingInterceptor extends java.lang.Object implements CallableProcessingInterceptor
AsyncRequestTimeoutException which is then handled by
Spring MVC's default exception handling as a 503 error.
Registered at the end, after all other interceptors and therefore invoked only if no other interceptor handles the timeout.
Note that according to RFC 7231, a 503 without a 'Retry-After' header is interpreted as a 500 error and the client should not retry. Applications can install their own interceptor to handle a timeout and add a 'Retry-After' header if necessary.
RESPONSE_HANDLED, RESULT_NONE| Constructor and Description |
|---|
TimeoutCallableProcessingInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
<T> java.lang.Object |
handleTimeout(NativeWebRequest request,
java.util.concurrent.Callable<T> task)
Invoked from a container thread when the async request times out before
the
Callable task completes. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitafterCompletion, beforeConcurrentHandling, handleError, postProcess, preProcesspublic TimeoutCallableProcessingInterceptor()
public <T> java.lang.Object handleTimeout(NativeWebRequest request, java.util.concurrent.Callable<T> task) throws java.lang.Exception
CallableProcessingInterceptorCallable task completes. Implementations may return a value,
including an Exception, to use instead of the value the
Callable did not return in time.
The default implementation always returns CallableProcessingInterceptor.RESULT_NONE.
handleTimeout in interface CallableProcessingInterceptorrequest - the current requesttask - the task for the current async requestCallableProcessingInterceptor.RESULT_NONE or CallableProcessingInterceptor.RESPONSE_HANDLED, concurrent processing
is resumed and subsequent interceptors are not invokedjava.lang.Exception - in case of errors