Enum Class SessionLockCheckStrategy

java.lang.Object
java.lang.Enum<SessionLockCheckStrategy>
com.vaadin.flow.server.SessionLockCheckStrategy
All Implemented Interfaces:
Serializable, Comparable<SessionLockCheckStrategy>, Constable

public enum SessionLockCheckStrategy extends Enum<SessionLockCheckStrategy>
Available strategies for session lock checking.
  • Enum Constant Details

    • ASSERT

      public static final SessionLockCheckStrategy ASSERT
      The default strategy, runs Java `assert` statement. Does nothing when assertions are disabled (the default for JVM).
    • LOG

      public static final SessionLockCheckStrategy LOG
      If the session doesn't have a lock, a warning message is logged to the log but the code execution continues normally.
    • THROW

      public static final SessionLockCheckStrategy THROW
      If the session doesn't have a lock, an IllegalStateException is thrown.
  • Method Details

    • values

      public static SessionLockCheckStrategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SessionLockCheckStrategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • checkHasLock

      public abstract void checkHasLock(VaadinSession session, String message)
      Potentially checks whether this session is currently locked by the current thread
      Parameters:
      session - the session to check the lock for, not null.
      message - the error message to include when failing if the check is done and the session is not locked