org.springframework.web.context.request.async
Class AbstractDelegatingCallable
java.lang.Object
org.springframework.web.context.request.async.AbstractDelegatingCallable
- All Implemented Interfaces:
- java.util.concurrent.Callable<java.lang.Object>
- Direct Known Subclasses:
- StaleAsyncRequestCheckingCallable
public abstract class AbstractDelegatingCallable
- extends java.lang.Object
- implements java.util.concurrent.Callable<java.lang.Object>
A base class for a Callable that can be used in a chain of Callable instances.
Typical use for async request processing scenarios involves:
- Create an instance of this type and register it via
AsyncExecutionChain.addDelegatingCallable(AbstractDelegatingCallable)
(internally the nodes of the chain will be linked so no need to set up "next").
- Provide an implementation of
Callable.call()
that contains the
logic needed to complete request processing outside the main processing thread.
- In the implementation, delegate to the next Callable to obtain
its result, e.g. ModelAndView, and then do some post-processing, e.g. view
resolution. In some cases both pre- and post-processing might be
appropriate, e.g. setting up
ThreadLocal
storage.
- Since:
- 3.2
- Author:
- Rossen Stoyanchev
- See Also:
AsyncExecutionChain
Method Summary |
protected java.util.concurrent.Callable<java.lang.Object> |
getNextCallable()
|
void |
setNextCallable(java.util.concurrent.Callable<java.lang.Object> nextCallable)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.concurrent.Callable |
call |
AbstractDelegatingCallable
public AbstractDelegatingCallable()
setNextCallable
public void setNextCallable(java.util.concurrent.Callable<java.lang.Object> nextCallable)
getNextCallable
protected java.util.concurrent.Callable<java.lang.Object> getNextCallable()