|
Generated by JDiff |
||||||||
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES |
This file contains all the changes in documentation in the packageorg.springframework.web.context.request.async
as colored differences. Deletions are shownlike this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.
Intercepts concurrent request handling, where the concurrent result is obtained by executing a Callable on behalf of the application with an AsyncTaskExecutor.A {@code CallableProcessingInterceptor} is invoked before and after the invocation of the {@code Callable} task in the asynchronous thread, as well as on timeout 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 {@code HandlerExceptionResolver} mechanism.
The afterTimeout method can select a value to be used to resume processing. @author Rossen Stoyanchev @author Rob Winch @since 3.2
Abstract adapter class for the CallableProcessingInterceptor interface, for simplified implementation of individual methods. @author Rossen Stoyanchev @author Rob Winch @since 3.2
{@code DeferredResult} provides an alternative to using a Callable for asynchronous request processing. While a {@code Callable} is executed concurrently on behalf of the application, with a {@code DeferredResult} the application can produce the result from a thread of its choice.Class DeferredResult, void setResultHandler(DeferredResultHandler)Subclasses can extend this class to easily associate additional data or behavior with the DeferredResult. For example, one might want to associate the user used to create the DeferredResult by extending the class and adding an addition property for the user. In this way, the user could easily be accessed later without the need to use a data structure to do the mapping.
An example of associating additional behavior to this class might be realized by extending the class to implement an additional interface. For example, one might want to implement a Comparable so that when the DeferredResult is added to a PriorityQueue it is handled in the correct order.
@author Rossen Stoyanchev @author Rob Winch @since 3.2
Provide a handler to use to handle the result value. @param resultHandler the handler @see DeferredResultProcessingInterceptor
Intercepts concurrent request handling, where the concurrent result is obtained by waiting for a DeferredResult to be set from a thread chosen by the application (e.g. in response to some external event).A {@code DeferredResultProcessingInterceptor} is invoked before the start of async processing, after the {@code DeferredResult} is set as well as on timeout, or 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 {@code HandlerExceptionResolver} mechanism.
The afterTimeout method can set the {@code DeferredResult} in order to resume processing. @author Rossen Stoyanchev @author Rob Winch @since 3.2
Abstract adapter class for the DeferredResultProcessingInterceptor interface for simplified implementation of individual methods. @author Rossen Stoyanchev @author Rob Winch @since 3.2
The central class for managing asynchronous request processing, mainly intended as an SPI and not typically used directly by application classes.Class WebAsyncManager, void registerCallableInterceptors(CallableProcessingInterceptor[])An async scenario starts with request processing as usual in a thread (T1). Concurrent request handling can be innitiated by calling #startCallableProcessing(Callable, Object...) startCallableProcessing or #startDeferredResultProcessing(DeferredResult, Object...) startDeferredResultProcessing both of which produce a result in a separate thread (T2). The result is saved and the request dispatched to the container, to resume processing with the saved result in a third thread (T3). Within the dispatched thread (T3), the saved result can be accessed via .getConcurrentResult() or its presence detected via .hasConcurrentResult(). @author Rossen Stoyanchev @since 3.2 @see org.springframework.web.context.request.AsyncWebRequestInterceptor @see org.springframework.web.servlet.AsyncHandlerInterceptor @see org.springframework.web.filter.OncePerRequestFilter#
shouldFilterAsyncDispatchesshouldNotFilterAsyncDispatch @see org.springframework.web.filter.OncePerRequestFilter#isAsyncDispatch @see org.springframework.web.filter.OncePerRequestFilter#isLastRequestThreadisAsyncDispatch
Register a CallableProcessingInterceptor without a key. The key is derived from the class name and hashcode. @paramClass WebAsyncManager, void registerDeferredResultInterceptors(DeferredResultProcessingInterceptor[])interceptorinterceptorstheone or moreinterceptorinterceptors to register
Register a DeferredResultProcessingInterceptor without a key. The key is derived from the class name and hashcode. @paramClass WebAsyncManager, void startCallableProcessing(Callable<?>, Object[])key the keyinterceptors one or@parammore interceptorsthe interceptorto register
Start concurrent request processing and execute the given task with an AsyncTaskExecutor. The result from the task execution is saved and the request dispatched in order to resume processing of that result. If the task raises an Exception then the saved result will be the raised Exception. @param callable a unit of work to be executed asynchronously @param processingContext additional context to save that can be accessed via .getConcurrentResultContext()Class WebAsyncManager, void startCallableProcessing(WebAsyncTask<?>, Object[])@throws Exception If concurrent processing failed to start @see #getConcurrentResult() @see #getConcurrentResultContext()
Use the givenClass WebAsyncManager, void startDeferredResultProcessing(DeferredResult<?>, Object[])MvcAsyncTaskWebAsyncTask to configure the task executor as well as the timeout value of the {@code AsyncWebRequest} before delegating to .startCallableProcessing(Callable, Object...). @parammvcAsyncTaskwebAsyncTask anMvcAsyncTaskWebAsyncTask containing the target {@code Callable} @param processingContext additional context to save that can be accessed via .getConcurrentResultContext() @throws Exception If concurrent processing failed to start
Start concurrent request processing and initialize the given DeferredResult with a DeferredResultHandler that saves the result and dispatches the request to resume processing of that result. The {@code AsyncWebRequest} is also updated with a completion handler that expires the {@code DeferredResult} and a timeout handler assuming the {@code DeferredResult} has a default timeout result. @param deferredResult the DeferredResult instance to initialize @param processingContext additional context to save that can be accessed via .getConcurrentResultContext()@throws Exception If concurrent processing failed to start @see #getConcurrentResult() @see #getConcurrentResultContext()