Class ThreadLocalVaadinRequestHolder

java.lang.Object
io.jmix.flowui.backgroundtask.ThreadLocalVaadinRequestHolder

public class ThreadLocalVaadinRequestHolder extends Object
Provides thread-local storage for Vaadin request. This utility class facilitates the transfer of Vaadin request to newly spawned threads that do not inherently have access to the data of the original Vaadin request.

This class mainly used to provide access to Vaadin request within UI.access(Command) closure in background tasks. It is not recommended to use this class in the application code.

Ensure that you clear the thread-local storage after use. Use clear() method once the thread-local data is no longer needed.

  • Constructor Details

    • ThreadLocalVaadinRequestHolder

      public ThreadLocalVaadinRequestHolder()
  • Method Details

    • setRequest

      public static void setRequest(@Nullable com.vaadin.flow.server.VaadinRequest request)
    • getRequest

      @Nullable public static com.vaadin.flow.server.VaadinRequest getRequest()
    • clear

      public static void clear()