类 CallableProcessingInterceptorAdapter
- java.lang.Object
- org.springframework.web.context.request.async.CallableProcessingInterceptorAdapter
- 所有已实现的接口:
CallableProcessingInterceptor
@Deprecated public abstract class CallableProcessingInterceptorAdapter extends Object implements CallableProcessingInterceptor
已过时。as of 5.0 where CallableProcessingInterceptor has default methodsAbstract adapter class for theCallableProcessingInterceptorinterface, for simplified implementation of individual methods.- 从以下版本开始:
- 3.2
- 作者:
- Rossen Stoyanchev, Rob Winch
字段概要
从接口继承的字段 org.springframework.web.context.request.async.CallableProcessingInterceptor
RESPONSE_HANDLED, RESULT_NONE
构造器概要
构造器 构造器 说明 CallableProcessingInterceptorAdapter()已过时。
方法概要
所有方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 <T> voidafterCompletion(NativeWebRequest request, Callable<T> task)已过时。Invoked from a container thread when async processing completes for any reason including timeout or network error.<T> voidbeforeConcurrentHandling(NativeWebRequest request, Callable<T> task)已过时。Invoked before the start of concurrent handling in the original thread in which theCallableis submitted for concurrent handling.<T> ObjecthandleError(NativeWebRequest request, Callable<T> task, Throwable t)已过时。Invoked from a container thread when an error occurred while processing the async request before theCallabletask completes.<T> ObjecthandleTimeout(NativeWebRequest request, Callable<T> task)已过时。Invoked from a container thread when the async request times out before theCallabletask completes.<T> voidpostProcess(NativeWebRequest request, Callable<T> task, Object concurrentResult)已过时。Invoked after theCallablehas produced a result in the async thread in which theCallableis executed.<T> voidpreProcess(NativeWebRequest request, Callable<T> task)已过时。Invoked after the start of concurrent handling in the async thread in which theCallableis executed and before the actual invocation of theCallable.
构造器详细资料
CallableProcessingInterceptorAdapter
public CallableProcessingInterceptorAdapter()
已过时。
方法详细资料
beforeConcurrentHandling
public <T> void beforeConcurrentHandling(NativeWebRequest request, Callable<T> task) throws Exception
已过时。从接口复制的说明:CallableProcessingInterceptorInvoked before the start of concurrent handling in the original thread in which theCallableis submitted for concurrent handling.This is useful for capturing the state of the current thread just prior to invoking the
Callable. Once the state is captured, it can then be transferred to the newThreadinCallableProcessingInterceptor.preProcess(NativeWebRequest, Callable). Capturing the state of Spring Security's SecurityContextHolder and migrating it to the new Thread is a concrete example of where this is useful.The default implementation is empty.
- 指定者:
beforeConcurrentHandling在接口中CallableProcessingInterceptor- 参数:
request- the current requesttask- the task for the current async request- 抛出:
Exception- in case of errors
preProcess
public <T> void preProcess(NativeWebRequest request, Callable<T> task) throws Exception
已过时。从接口复制的说明:CallableProcessingInterceptorInvoked after the start of concurrent handling in the async thread in which theCallableis executed and before the actual invocation of theCallable.The default implementation is empty.
- 指定者:
preProcess在接口中CallableProcessingInterceptor- 参数:
request- the current requesttask- the task for the current async request- 抛出:
Exception- in case of errors
postProcess
public <T> void postProcess(NativeWebRequest request, Callable<T> task, Object concurrentResult) throws Exception
已过时。从接口复制的说明:CallableProcessingInterceptorInvoked after theCallablehas produced a result in the async thread in which theCallableis executed. This method may be invoked later thanafterTimeoutorafterCompletiondepending on when theCallablefinishes processing.The default implementation is empty.
- 指定者:
postProcess在接口中CallableProcessingInterceptor- 参数:
request- the current requesttask- the task for the current async requestconcurrentResult- the result of concurrent processing, which could be aThrowableif theCallableraised an exception- 抛出:
Exception- in case of errors
handleTimeout
public <T> Object handleTimeout(NativeWebRequest request, Callable<T> task) throws Exception
已过时。从接口复制的说明:CallableProcessingInterceptorInvoked from a container thread when the async request times out before theCallabletask completes. Implementations may return a value, including anException, to use instead of the value theCallabledid not return in time.The default implementation always returns
CallableProcessingInterceptor.RESULT_NONE.- 指定者:
handleTimeout在接口中CallableProcessingInterceptor- 参数:
request- the current requesttask- the task for the current async request- 返回:
- a concurrent result value; if the value is anything other than
CallableProcessingInterceptor.RESULT_NONEorCallableProcessingInterceptor.RESPONSE_HANDLED, concurrent processing is resumed and subsequent interceptors are not invoked - 抛出:
Exception- in case of errors
handleError
public <T> Object handleError(NativeWebRequest request, Callable<T> task, Throwable t) throws Exception
已过时。从接口复制的说明:CallableProcessingInterceptorInvoked from a container thread when an error occurred while processing the async request before theCallabletask completes. Implementations may return a value, including anException, to use instead of the value theCallabledid not return in time.The default implementation always returns
CallableProcessingInterceptor.RESULT_NONE.- 指定者:
handleError在接口中CallableProcessingInterceptor- 参数:
request- the current requesttask- the task for the current async requestt- the error that occurred while request processing- 返回:
- a concurrent result value; if the value is anything other than
CallableProcessingInterceptor.RESULT_NONEorCallableProcessingInterceptor.RESPONSE_HANDLED, concurrent processing is resumed and subsequent interceptors are not invoked - 抛出:
Exception- in case of errors
afterCompletion
public <T> void afterCompletion(NativeWebRequest request, Callable<T> task) throws Exception
已过时。从接口复制的说明:CallableProcessingInterceptorInvoked from a container thread when async processing completes for any reason including timeout or network error.The default implementation is empty.
- 指定者:
afterCompletion在接口中CallableProcessingInterceptor- 参数:
request- the current requesttask- the task for the current async request- 抛出:
Exception- in case of errors