Polish async support
Added handler argument to the signature of AsyncHandlerInterceptor.afterConcurrentHandlingStarted(..). Renamed AsyncWebUtils to WebAsyncUtils.
This commit is contained in:
@@ -32,7 +32,7 @@ import org.springframework.orm.hibernate3.SessionHolder;
|
||||
import org.springframework.transaction.support.TransactionSynchronizationManager;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.context.request.async.AsyncWebUtils;
|
||||
import org.springframework.web.context.request.async.WebAsyncUtils;
|
||||
import org.springframework.web.context.request.async.WebAsyncManager;
|
||||
import org.springframework.web.context.request.async.WebAsyncManager.WebAsyncThreadInitializer;
|
||||
import org.springframework.web.context.support.WebApplicationContextUtils;
|
||||
@@ -184,7 +184,7 @@ public class OpenSessionInViewFilter extends OncePerRequestFilter {
|
||||
SessionFactory sessionFactory = lookupSessionFactory(request);
|
||||
boolean participate = false;
|
||||
|
||||
WebAsyncManager asyncManager = AsyncWebUtils.getAsyncManager(request);
|
||||
WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(request);
|
||||
boolean isFirstRequest = !isAsyncDispatch(request);
|
||||
String key = getAlreadyFilteredAttributeName();
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.context.request.AsyncWebRequestInterceptor;
|
||||
import org.springframework.web.context.request.WebRequest;
|
||||
import org.springframework.web.context.request.async.AsyncWebUtils;
|
||||
import org.springframework.web.context.request.async.WebAsyncUtils;
|
||||
import org.springframework.web.context.request.async.WebAsyncManager;
|
||||
import org.springframework.web.context.request.async.WebAsyncManager.WebAsyncThreadInitializer;
|
||||
|
||||
@@ -143,7 +143,7 @@ public class OpenSessionInViewInterceptor extends HibernateAccessor implements A
|
||||
*/
|
||||
public void preHandle(WebRequest request) throws DataAccessException {
|
||||
|
||||
WebAsyncManager asyncManager = AsyncWebUtils.getAsyncManager(request);
|
||||
WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(request);
|
||||
String participateAttributeName = getParticipateAttributeName();
|
||||
|
||||
if (asyncManager.hasConcurrentResult()) {
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.springframework.orm.hibernate4.SessionFactoryUtils;
|
||||
import org.springframework.orm.hibernate4.SessionHolder;
|
||||
import org.springframework.transaction.support.TransactionSynchronizationManager;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.context.request.async.AsyncWebUtils;
|
||||
import org.springframework.web.context.request.async.WebAsyncUtils;
|
||||
import org.springframework.web.context.request.async.WebAsyncManager;
|
||||
import org.springframework.web.context.request.async.WebAsyncManager.WebAsyncThreadInitializer;
|
||||
import org.springframework.web.context.support.WebApplicationContextUtils;
|
||||
@@ -117,7 +117,7 @@ public class OpenSessionInViewFilter extends OncePerRequestFilter {
|
||||
SessionFactory sessionFactory = lookupSessionFactory(request);
|
||||
boolean participate = false;
|
||||
|
||||
WebAsyncManager asyncManager = AsyncWebUtils.getAsyncManager(request);
|
||||
WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(request);
|
||||
boolean isFirstRequest = !isAsyncDispatch(request);
|
||||
String key = getAlreadyFilteredAttributeName();
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.context.request.AsyncWebRequestInterceptor;
|
||||
import org.springframework.web.context.request.WebRequest;
|
||||
import org.springframework.web.context.request.async.AsyncWebUtils;
|
||||
import org.springframework.web.context.request.async.WebAsyncUtils;
|
||||
import org.springframework.web.context.request.async.WebAsyncManager;
|
||||
import org.springframework.web.context.request.async.WebAsyncManager.WebAsyncThreadInitializer;
|
||||
|
||||
@@ -107,7 +107,7 @@ public class OpenSessionInViewInterceptor implements AsyncWebRequestInterceptor
|
||||
|
||||
String participateAttributeName = getParticipateAttributeName();
|
||||
|
||||
WebAsyncManager asyncManager = AsyncWebUtils.getAsyncManager(request);
|
||||
WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(request);
|
||||
if (asyncManager.hasConcurrentResult()) {
|
||||
if (asyncManager.initializeAsyncThread(participateAttributeName)) {
|
||||
return;
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.springframework.orm.jpa.EntityManagerHolder;
|
||||
import org.springframework.transaction.support.TransactionSynchronizationManager;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.context.request.async.AsyncWebUtils;
|
||||
import org.springframework.web.context.request.async.WebAsyncUtils;
|
||||
import org.springframework.web.context.request.async.WebAsyncManager;
|
||||
import org.springframework.web.context.request.async.WebAsyncManager.WebAsyncThreadInitializer;
|
||||
import org.springframework.web.context.support.WebApplicationContextUtils;
|
||||
@@ -141,7 +141,7 @@ public class OpenEntityManagerInViewFilter extends OncePerRequestFilter {
|
||||
EntityManagerFactory emf = lookupEntityManagerFactory(request);
|
||||
boolean participate = false;
|
||||
|
||||
WebAsyncManager asyncManager = AsyncWebUtils.getAsyncManager(request);
|
||||
WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(request);
|
||||
boolean isFirstRequest = !isAsyncDispatch(request);
|
||||
String key = getAlreadyFilteredAttributeName();
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.context.request.AsyncWebRequestInterceptor;
|
||||
import org.springframework.web.context.request.WebRequest;
|
||||
import org.springframework.web.context.request.async.AsyncWebUtils;
|
||||
import org.springframework.web.context.request.async.WebAsyncUtils;
|
||||
import org.springframework.web.context.request.async.WebAsyncManager;
|
||||
import org.springframework.web.context.request.async.WebAsyncManager.WebAsyncThreadInitializer;
|
||||
|
||||
@@ -74,7 +74,7 @@ public class OpenEntityManagerInViewInterceptor extends EntityManagerFactoryAcce
|
||||
|
||||
String participateAttributeName = getParticipateAttributeName();
|
||||
|
||||
WebAsyncManager asyncManager = AsyncWebUtils.getAsyncManager(request);
|
||||
WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(request);
|
||||
if (asyncManager.hasConcurrentResult()) {
|
||||
if (asyncManager.initializeAsyncThread(participateAttributeName)) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user