Example usage for org.springframework.web.context.request.async CallableProcessingInterceptor handleTimeout

List of usage examples for org.springframework.web.context.request.async CallableProcessingInterceptor handleTimeout

Introduction

In this page you can find the example usage for org.springframework.web.context.request.async CallableProcessingInterceptor handleTimeout.

Prototype

default <T> Object handleTimeout(NativeWebRequest request, Callable<T> task) throws Exception 

Source Link

Document

Invoked from a container thread when the async request times out before the Callable task completes.

Usage

From source file:org.springframework.web.context.request.async.CallableInterceptorChain.java

public Object triggerAfterTimeout(NativeWebRequest request, Callable<?> task) {
    cancelTask();// w ww  . j a  v a2 s .  co m
    for (CallableProcessingInterceptor interceptor : this.interceptors) {
        try {
            Object result = interceptor.handleTimeout(request, task);
            if (result == CallableProcessingInterceptor.RESPONSE_HANDLED) {
                break;
            } else if (result != CallableProcessingInterceptor.RESULT_NONE) {
                return result;
            }
        } catch (Throwable t) {
            return t;
        }
    }
    return CallableProcessingInterceptor.RESULT_NONE;
}