类 HttpSessionMutexListener
- java.lang.Object
- org.springframework.web.util.HttpSessionMutexListener
- 所有已实现的接口:
EventListener
,HttpSessionListener
public class HttpSessionMutexListener extends Object implements HttpSessionListener
Servlet HttpSessionListener that automatically exposes the session mutex when an HttpSession gets created. To be registered as a listener inweb.xml
.The session mutex is guaranteed to be the same object during the entire lifetime of the session, available under the key defined by the
SESSION_MUTEX_ATTRIBUTE
constant. It serves as a safe reference to synchronize on for locking on the current session.In many cases, the HttpSession reference itself is a safe mutex as well, since it will always be the same object reference for the same active logical session. However, this is not guaranteed across different servlet containers; the only 100% safe way is a session mutex.
- 从以下版本开始:
- 1.2.7
- 作者:
- Juergen Hoeller
- 另请参阅:
WebUtils.SESSION_MUTEX_ATTRIBUTE
,WebUtils.getSessionMutex(javax.servlet.http.HttpSession)
,AbstractController.setSynchronizeOnSession(boolean)
构造器概要
构造器 构造器 说明 HttpSessionMutexListener()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
sessionCreated(HttpSessionEvent event)
void
sessionDestroyed(HttpSessionEvent event)
构造器详细资料
HttpSessionMutexListener
public HttpSessionMutexListener()
方法详细资料
sessionCreated
public void sessionCreated(HttpSessionEvent event)
- 指定者:
sessionCreated
在接口中HttpSessionListener
sessionDestroyed
public void sessionDestroyed(HttpSessionEvent event)
- 指定者:
sessionDestroyed
在接口中HttpSessionListener