Example usage for org.springframework.web.servlet AsyncHandlerInterceptor afterConcurrentHandlingStarted

List of usage examples for org.springframework.web.servlet AsyncHandlerInterceptor afterConcurrentHandlingStarted

Introduction

In this page you can find the example usage for org.springframework.web.servlet AsyncHandlerInterceptor afterConcurrentHandlingStarted.

Prototype

default void afterConcurrentHandlingStarted(HttpServletRequest request, HttpServletResponse response,
        Object handler) throws Exception 

Source Link

Document

Called instead of postHandle and afterCompletion when the handler is being executed concurrently.

Usage

From source file:jun.learn.scene.handlerMapping.HandlerExecutionChain.java

/**
 * Apply afterConcurrentHandlerStarted callback on mapped AsyncHandlerInterceptors.
 *///w w w.  ja va  2  s  . co m
void applyAfterConcurrentHandlingStarted(HttpServletRequest request, HttpServletResponse response) {
    HandlerInterceptor[] interceptors = getInterceptors();
    if (!ObjectUtils.isEmpty(interceptors)) {
        for (int i = interceptors.length - 1; i >= 0; i--) {
            if (interceptors[i] instanceof AsyncHandlerInterceptor) {
                try {
                    AsyncHandlerInterceptor asyncInterceptor = (AsyncHandlerInterceptor) interceptors[i];
                    asyncInterceptor.afterConcurrentHandlingStarted(request, response, this.handler);
                } catch (Throwable ex) {
                    logger.error(
                            "Interceptor [" + interceptors[i] + "] failed in afterConcurrentHandlingStarted",
                            ex);
                }
            }
        }
    }
}