java.lang.Object
com.vaadin.kubernetes.starter.sessiontracker.SessionUtil

public class SessionUtil extends Object
Utility class for session operations.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Runnable
    injectLockIfNeeded(com.vaadin.flow.server.VaadinSession session)
    VaadinSession lock is usually set by calling VaadinSession.refreshTransients(WrappedSession, VaadinService), but during deserialization none of the required objects are available.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SessionUtil

      public SessionUtil()
  • Method Details

    • injectLockIfNeeded

      public static Runnable injectLockIfNeeded(com.vaadin.flow.server.VaadinSession session)
      VaadinSession lock is usually set by calling VaadinSession.refreshTransients(WrappedSession, VaadinService), but during deserialization none of the required objects are available. This method gets the lock instance if exists, or injects a temporary lock instance into the provided VaadinSession, acquires the lock, and returns a runnable that will unlock or remove the lock when executed.
      Parameters:
      session - the session to be locked if needed
      Returns:
      a runnable that will unlock or remove the lock when executed, or a no-op in case of any error