Spring Framework

org.springframework.web.context.request.async
Class StaleAsyncRequestCheckingCallable

java.lang.Object
  extended by org.springframework.web.context.request.async.AbstractDelegatingCallable
      extended by org.springframework.web.context.request.async.StaleAsyncRequestCheckingCallable
All Implemented Interfaces:
java.util.concurrent.Callable<java.lang.Object>

public class StaleAsyncRequestCheckingCallable
extends AbstractDelegatingCallable

Invokes the next Callable in a chain and then checks if the AsyncWebRequest provided to the constructor has ended before returning. Since a timeout or a (client) error may occur in a separate thread while async request processing is still in progress in its own thread, inserting this Callable in the chain protects against use of stale async requests.

If an async request was terminated while the next Callable was still processing, a StaleAsyncWebRequestException is raised.

Since:
3.2
Author:
Rossen Stoyanchev

Constructor Summary
StaleAsyncRequestCheckingCallable(AsyncWebRequest asyncWebRequest)
           
 
Method Summary
 java.lang.Object call()
           
 
Methods inherited from class org.springframework.web.context.request.async.AbstractDelegatingCallable
getNextCallable, setNextCallable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaleAsyncRequestCheckingCallable

public StaleAsyncRequestCheckingCallable(AsyncWebRequest asyncWebRequest)
Method Detail

call

public java.lang.Object call()
                      throws java.lang.Exception
Throws:
java.lang.Exception

Spring Framework