类 WebSessionMutexListener

java.lang.Object
cn.taketoday.web.util.WebSessionMutexListener
所有已实现的接口:
WebSessionListener, EventListener

public class WebSessionMutexListener extends Object implements WebSessionListener
WebSessionListener that automatically exposes the session mutex when an WebSession gets created. To be registered as a listener in web.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 WebSession 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 containers; the only 100% safe way is a session mutex.

从以下版本开始:
4.0 2022/4/9 09:58
作者:
Juergen Hoeller, Harry Yang
另请参阅:
  • 构造器详细资料

    • WebSessionMutexListener

      public WebSessionMutexListener()
  • 方法详细资料

    • sessionCreated

      public void sessionCreated(WebSessionEvent event)
      从接口复制的说明: WebSessionListener
      Receives notification that a session has been created.

      The default implementation takes no action.

      指定者:
      sessionCreated 在接口中 WebSessionListener
      参数:
      event - the WebSessionEvent containing the session
    • sessionDestroyed

      public void sessionDestroyed(WebSessionEvent event)
      从接口复制的说明: WebSessionListener
      Receives notification that a session is about to be invalidated.

      The default implementation takes no action.

      指定者:
      sessionDestroyed 在接口中 WebSessionListener
      参数:
      event - the WebSessionEvent containing the session