Callable on behalf of the application with
an AsyncTaskExecutor.
A CallableProcessingInterceptor is invoked before and after the
invocation of the Callable task in the asynchronous thread, as well
as on timeout/error from a container thread, or after completing for any reason
including a timeout or network error.
As a general rule exceptions raised by interceptor methods will cause
async processing to resume by dispatching back to the container and using
the Exception instance as the concurrent result. Such exceptions will then
be processed through the HandlerExceptionResolver mechanism.
The handleTimeout method
can select a value to be used to resume processing.
| Modifier and Type | Field and Description |
|---|---|
| public static final Object | RESPONSE_HANDLED
Constant indicating that the response has been handled by this interceptor without a result and that no further interceptors are to be invoked. |
| public static final Object | RESULT_NONE
Constant indicating that no result has been determined by this interceptor, giving subsequent interceptors a chance. |
| Modifier and Type | Method and Description |
|---|---|
| public default <T> void | afterCompletion(NativeWebRequest
the current request request, Callable<T> the task for the current async request task)Invoked from a container thread when async processing completes for any reason including timeout or network error. |
| public default <T> void | beforeConcurrentHandling(NativeWebRequest
the current request request, Callable<T> the task for the current async request task)Invoked before the start of concurrent handling in the original
thread in which the |
| public default <T> Object | Returns: a concurrent result value; if the value is anything other thanRESULT_NONE or RESPONSE_HANDLED, concurrent processing
is resumed and subsequent interceptors are not invokedthe current request request, Callable<T> the task for the current async request task, Throwable the error that occurred while request processing t)Invoked from a container thread when an error occurred while processing
the async request before the |
| public default <T> Object | Returns: a concurrent result value; if the value is anything other thanRESULT_NONE or RESPONSE_HANDLED, concurrent processing
is resumed and subsequent interceptors are not invokedthe current request request, Callable<T> the task for the current async request task)Invoked from a container thread when the async request times out before
the |
| public default <T> void | postProcess(NativeWebRequest
the current request request, Callable<T> the task for the current async request task, Object the result of concurrent processing, which could
be a concurrentResult)Throwable if the Callable raised an exceptionInvoked after the |
| public default <T> void | preProcess(NativeWebRequest
the current request request, Callable<T> the task for the current async request task)Invoked after the start of concurrent handling in the async
thread in which the |
| RESPONSE_HANDLED | back to summary |
|---|---|
| public static final Object RESPONSE_HANDLED Constant indicating that the response has been handled by this interceptor without a result and that no further interceptors are to be invoked.
| |
| RESULT_NONE | back to summary |
|---|---|
| public static final Object RESULT_NONE Constant indicating that no result has been determined by this interceptor, giving subsequent interceptors a chance.
| |
| afterCompletion | back to summary |
|---|---|
| public default <T> void afterCompletion(NativeWebRequest request, Callable<T> task) throws Exception Invoked from a container thread when async processing completes for any reason including timeout or network error. The default implementation is empty.
| |
| beforeConcurrentHandling | back to summary |
|---|---|
| public default <T> void beforeConcurrentHandling(NativeWebRequest request, Callable<T> task) throws Exception Invoked before the start of concurrent handling in the original
thread in which the This is useful for capturing the state of the current thread just prior to
invoking the The default implementation is empty.
| |
| handleError | back to summary |
|---|---|
| public default <T> Object handleError(NativeWebRequest request, Callable<T> task, Throwable t) throws Exception Invoked from a container thread when an error occurred while processing
the async request before the The default implementation always returns
| |
| handleTimeout | back to summary |
|---|---|
| public default <T> Object handleTimeout(NativeWebRequest request, Callable<T> task) throws Exception Invoked from a container thread when the async request times out before
the The default implementation always returns
| |
| postProcess | back to summary |
|---|---|
| public default <T> void postProcess(NativeWebRequest request, Callable<T> task, Object concurrentResult) throws Exception Invoked after the The default implementation is empty.
| |
| preProcess | back to summary |
|---|---|
| public default <T> void preProcess(NativeWebRequest request, Callable<T> task) throws Exception Invoked after the start of concurrent handling in the async
thread in which the The default implementation is empty.
| |