Generated by
JDiff

org.springframework.web.context.request.async Documentation Differences

This file contains all the changes in documentation in the package org.springframework.web.context.request.async as colored differences. Deletions are shown like 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.

Class AsyncWebRequest, void addCompletionHandler(Runnable)

Add a Runnablehandle to beinvoke invoked when request processing completes.

Class DeferredResult

{@code DeferredResult} provides an alternative to using a Callable for asynchronous request processing. While a {@code Callable} is executed concurrently executed concurrently on behalf of the application, with a {@code DeferredResult} thethe application can produce produce the result from a thread of its choice. @author Rossen Stoyanchev @since 3.2
Class DeferredResult, constructor DeferredResult(Long, Object)

Create a DeferredResult with a timeout value and a default result to useuse in case onof timeout. @param timeout timeout value in milliseconds; ignored if {@code null} @param timeoutResult the result to use, possibly {@code null}
Class DeferredResult, constructor DeferredResult(long)

Create a DeferredResult with a timeout value. @param timeout timeout value in milliseconds
Class DeferredResult, boolean isSetOrExpired()

WhetherReturn the{@code true} if this DeferredResult canis no longer beusable either because it was previously set eitheror because the async underlying request expired.

The result may have been set with a call to .setResult(Object), or because.setErrorResult(Object), itor as a result of a timeout, if a timeout result was alreadyprovided setto the constructor. The request may also expire due to a timeout or network error.

Class DeferredResult, boolean setErrorResult(Object)

Set an error result value and passfor the itDeferredResult on for handlingand handle it. IfThe the result is an value may be an Exception or Throwable, it will be processed as though the controller raised thein exception.which Otherwisecase it will bebe processed as if the controller returneda handler raised the given resultexception. @param result the error result value @return "true" if the result was set to the error value and passed on forfor handling; "false" if the result was already set or the async requestrequest expired. @see #isSetOrExpired()
Class DeferredResult, boolean setResult(T)

Set the result value and pass it on for handlingfor the DeferredResult and handle it. @param result the resultvalue to value set @return "true" if the result was set and passed on for handling; "false" if the result was already set or the async request expired. @see #isSetOrExpired()
Class DeferredResult, void setResultHandler(DeferredResultHandler)

SetProvide a handler to use to handle the result when setvalue. Normally applications do not use this method at@param runtimeresultHandler but may dothe sohandler during@see testing.DeferredResultProcessingInterceptor

Class WebAsyncManager

The central class for managing asynchronous request processing, mainly intended as an SPI and not typically used directly by application classes.

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(). TODO .. Servlet 3 config @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#shouldFilterAsyncDispatches @see org.springframework.web.filter.OncePerRequestFilter#isAsyncDispatch @see org.springframework.web.filter.OncePerRequestFilter#isLastRequestThread

Class WebAsyncManager, Object getConcurrentResult()

Provides access to the result from concurrent handling. @return an Object, possibly an {@code Exception} or {@code Throwable} if concurrentconcurrent handling raised one. @see #clearConcurrentResult()
Class WebAsyncManager, Object[] getConcurrentResultContext()

Provides access to additional processing context saved at the start of concurrent handling. @see #clearConcurrentResult()
Class WebAsyncManager, boolean hasConcurrentResult()

Whether thea request has beenresult dispatched to process thevalue exists as a result of of concurrent handling.
Class WebAsyncManager, void setAsyncWebRequest(AsyncWebRequest)

Configure the AsyncWebRequest to use. This property may be setbe set more than once during a single request to accurately reflect the the currentcurrent state of the request (e.g. following a forward, request/response wrapping, etc). However, it should not be set while concurrent handlinghandling is is in progress, i.e. while .isConcurrentHandlingStarted() isis {@code true}. @param asyncWebRequest the web request to use
Class WebAsyncManager, void startCallableProcessing(Callable<?>, Object[])

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 viavia .getConcurrentResultContext() @see #getConcurrentResult() @see #getConcurrentResultContext()
Class WebAsyncManager, void startCallableProcessing(MvcAsyncTask<?>, Object[])

Use the given AsyncTaskMvcAsyncTask to configure the task executor as well as the timeout value of the {@code AsyncWebRequest} before delegating to .startCallableProcessing(Callable, Object...). @param asyncTaskmvcAsyncTask an asyncTaskMvcAsyncTask containing the target {@code Callable} @param processingContext additional context to save that can be accessed viavia .getConcurrentResultContext()
Class WebAsyncManager, void startDeferredResultProcessing(DeferredResult<?>, Object[])

Start concurrent request processing and initialize the givengiven DeferredResult with a DeferredResultHandler that savessaves the result and dispatches dispatches the request to resume processing of thatthat result. The {@code AsyncWebRequest} is also updated with a completioncompletion handler that that expires the {@code DeferredResult} and a timeout handlerhandler assuming the 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 viavia .getConcurrentResultContext() @see #getConcurrentResult() @see #getConcurrentResultContext()