Ensure async Callables are in sync with the call stack

After this change each call stack level pushes and pops an async
Callable to ensure the AsyncExecutionChain is in sync with the
call stack. Before this change, a controller returning a "forward:"
prefixed string caused the AsyncExecutionChain to contain a
extra Callables that did not match the actual call stack.

Issue: SPR-9611
This commit is contained in:
Rossen Stoyanchev
2012-07-20 10:54:58 -04:00
parent 33a3681975
commit 6cc512b51c
27 changed files with 240 additions and 239 deletions

View File

@@ -176,7 +176,7 @@ public class OpenSessionInViewTests {
verify(sf);
verify(session);
asyncCallable.setNextCallable(new Callable<Object>() {
asyncCallable.setNext(new Callable<Object>() {
public Object call() {
return null;
}
@@ -484,7 +484,7 @@ public class OpenSessionInViewTests {
verify(asyncWebRequest);
chain.setTaskExecutor(new SyncTaskExecutor());
chain.setCallable(new Callable<Object>() {
chain.setLastCallable(new Callable<Object>() {
public Object call() {
assertTrue(TransactionSynchronizationManager.hasResource(sf));
return null;
@@ -503,7 +503,7 @@ public class OpenSessionInViewTests {
replay(sf);
replay(session);
chain.startCallableChainProcessing();
chain.startCallableProcessing();
assertFalse(TransactionSynchronizationManager.hasResource(sf));
verify(sf);