当前位置: 首页>>代码示例>>Java>>正文


Java WebUtils.getSessionMutex方法代码示例

本文整理汇总了Java中org.springframework.web.util.WebUtils.getSessionMutex方法的典型用法代码示例。如果您正苦于以下问题:Java WebUtils.getSessionMutex方法的具体用法?Java WebUtils.getSessionMutex怎么用?Java WebUtils.getSessionMutex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.web.util.WebUtils的用法示例。


在下文中一共展示了WebUtils.getSessionMutex方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleInternal

import org.springframework.web.util.WebUtils; //导入方法依赖的package包/类
@Override
protected ModelAndView handleInternal(HttpServletRequest request,
		HttpServletResponse response, HandlerMethod handlerMethod) throws Exception {

	checkRequest(request);

	if (getSessionAttributesHandler(handlerMethod).hasSessionAttributes()) {
		applyCacheSeconds(response, this.cacheSecondsForSessionAttributeHandlers);
	}
	else {
		prepareResponse(response);
	}

	// Execute invokeHandlerMethod in synchronized block if required.
	if (this.synchronizeOnSession) {
		HttpSession session = request.getSession(false);
		if (session != null) {
			Object mutex = WebUtils.getSessionMutex(session);
			synchronized (mutex) {
				return invokeHandlerMethod(request, response, handlerMethod);
			}
		}
	}

	return invokeHandlerMethod(request, response, handlerMethod);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:27,代码来源:RequestMappingHandlerAdapter.java

示例2: handleRequest

import org.springframework.web.util.WebUtils; //导入方法依赖的package包/类
@Override
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
		throws Exception {

	// Delegate to WebContentGenerator for checking and preparing.
	checkRequest(request);
	prepareResponse(response);

	// Execute handleRequestInternal in synchronized block if required.
	if (this.synchronizeOnSession) {
		HttpSession session = request.getSession(false);
		if (session != null) {
			Object mutex = WebUtils.getSessionMutex(session);
			synchronized (mutex) {
				return handleRequestInternal(request, response);
			}
		}
	}

	return handleRequestInternal(request, response);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:22,代码来源:AbstractController.java

示例3: handle

import org.springframework.web.util.WebUtils; //导入方法依赖的package包/类
@Override
public ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object handler)
		throws Exception {

	Class<?> clazz = ClassUtils.getUserClass(handler);
	Boolean annotatedWithSessionAttributes = this.sessionAnnotatedClassesCache.get(clazz);
	if (annotatedWithSessionAttributes == null) {
		annotatedWithSessionAttributes = (AnnotationUtils.findAnnotation(clazz, SessionAttributes.class) != null);
		this.sessionAnnotatedClassesCache.put(clazz, annotatedWithSessionAttributes);
	}

	if (annotatedWithSessionAttributes) {
		checkAndPrepare(request, response, this.cacheSecondsForSessionAttributeHandlers, true);
	}
	else {
		checkAndPrepare(request, response, true);
	}

	// Execute invokeHandlerMethod in synchronized block if required.
	if (this.synchronizeOnSession) {
		HttpSession session = request.getSession(false);
		if (session != null) {
			Object mutex = WebUtils.getSessionMutex(session);
			synchronized (mutex) {
				return invokeHandlerMethod(request, response, handler);
			}
		}
	}

	return invokeHandlerMethod(request, response, handler);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:32,代码来源:AnnotationMethodHandlerAdapter.java

示例4: getSessionMutex

import org.springframework.web.util.WebUtils; //导入方法依赖的package包/类
@Override
public Object getSessionMutex() {
	return WebUtils.getSessionMutex(getSession(true));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:ServletRequestAttributes.java

示例5: getFlashMapsMutex

import org.springframework.web.util.WebUtils; //导入方法依赖的package包/类
/**
 * Exposes the best available session mutex.
 * @see org.springframework.web.util.WebUtils#getSessionMutex
 * @see org.springframework.web.util.HttpSessionMutexListener
 */
@Override
protected Object getFlashMapsMutex(HttpServletRequest request) {
	return WebUtils.getSessionMutex(request.getSession());
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:10,代码来源:SessionFlashMapManager.java


注:本文中的org.springframework.web.util.WebUtils.getSessionMutex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。