DeferredResult to be set from a thread
chosen by the application (e.g. in response to some external event).
A DeferredResultProcessingInterceptor is invoked before the start
of async processing, after the DeferredResult is set as well as on
timeout/error, 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 set the DeferredResult in order to resume processing.
| Modifier and Type | Method and Description |
|---|---|
| public default <T> void | afterCompletion(NativeWebRequest
the current request request, DeferredResult<T> the DeferredResult for the current request deferredResult)Invoked from a container thread when an async request completed for any reason including timeout and network error. |
| public default <T> void | beforeConcurrentHandling(NativeWebRequest
the current request request, DeferredResult<T> the DeferredResult for the current request deferredResult)Invoked immediately before the start of concurrent handling, in the same thread that started it. |
| public default <T> boolean | Returns: true if error handling should continue, or false if
other interceptors should be bypassed and not be invokedthe current request request, DeferredResult<T> the DeferredResult for the current request; if the
deferredResult, Throwable DeferredResult is set, then concurrent processing is resumed and
subsequent interceptors are not invokedthe error that occurred while request processing t)Invoked from a container thread when an error occurred while processing an async request
before the |
| public default <T> boolean | Returns: true if processing should continue, or false if
other interceptors should not be invokedthe current request request, DeferredResult<T> the DeferredResult for the current request; if the
deferredResult)DeferredResult is set, then concurrent processing is resumed and
subsequent interceptors are not invokedInvoked from a container thread when an async request times out before
the |
| public default <T> void | postProcess(NativeWebRequest
the current request request, DeferredResult<T> the DeferredResult for the current request deferredResult, Object the concurrent result concurrentResult)Invoked after a |
| public default <T> void | preProcess(NativeWebRequest
the current request request, DeferredResult<T> the DeferredResult for the current request deferredResult)Invoked immediately after the start of concurrent handling, in the same thread that started it. |
| afterCompletion | back to summary |
|---|---|
| public default <T> void afterCompletion(NativeWebRequest request, DeferredResult<T> deferredResult) throws Exception Invoked from a container thread when an async request completed for any
reason including timeout and network error. This method is useful for
detecting that a
| |
| beforeConcurrentHandling | back to summary |
|---|---|
| public default <T> void beforeConcurrentHandling(NativeWebRequest request, DeferredResult<T> deferredResult) throws Exception Invoked immediately before the start of concurrent handling, in the same
thread that started it. This method may be used to capture state just prior
to the start of concurrent processing with the given
| |
| handleError | back to summary |
|---|---|
| public default <T> boolean handleError(NativeWebRequest request, DeferredResult<T> deferredResult, Throwable t) throws Exception Invoked from a container thread when an error occurred while processing an async request
before the
| |
| handleTimeout | back to summary |
|---|---|
| public default <T> boolean handleTimeout(NativeWebRequest request, DeferredResult<T> deferredResult) throws Exception Invoked from a container thread when an async request times out before
the
| |
| postProcess | back to summary |
|---|---|
| public default <T> void postProcess(NativeWebRequest request, DeferredResult<T> deferredResult, Object concurrentResult) throws Exception Invoked after a This method may also be invoked after a timeout when the
| |
| preProcess | back to summary |
|---|---|
| public default <T> void preProcess(NativeWebRequest request, DeferredResult<T> deferredResult) throws Exception Invoked immediately after the start of concurrent handling, in the same
thread that started it. This method may be used to detect the start of
concurrent processing with the given The
| |