Class BackgroundTask.ProgressListenerAdapter<T,V>

java.lang.Object
io.jmix.flowui.backgroundtask.BackgroundTask.ProgressListenerAdapter<T,V>
Type Parameters:
T - the type of the progress updates provided when the onProgress method is called
V - the type of the final result when the onDone method is called
All Implemented Interfaces:
BackgroundTask.ProgressListener<T,V>
Enclosing class:
BackgroundTask<T,V>

public static class BackgroundTask.ProgressListenerAdapter<T,V> extends Object implements BackgroundTask.ProgressListener<T,V>
A default implementation of the BackgroundTask.ProgressListener interface with empty method bodies.
  • Constructor Details

    • ProgressListenerAdapter

      public ProgressListenerAdapter()
  • Method Details

    • onProgress

      public void onProgress(List<T> changes)
      Description copied from interface: BackgroundTask.ProgressListener
      Provides exclusive access to this UI from outside a request handling thread on progress change.

      Please note that the command might be invoked on a different thread or later on the current thread, which means that custom thread locals might not have the expected values when the command is executed. UI.getCurrent(), VaadinSession.getCurrent() and VaadinService.getCurrent() are set according to this UI before executing the command. Other standard CurrentInstance values such as VaadinService.getCurrentRequest() and VaadinService.getCurrentResponse() will not be defined.

      Specified by:
      onProgress in interface BackgroundTask.ProgressListener<T,V>
      Parameters:
      changes - list of changes since previous invocation
      See Also:
      • UI.access(Command)
    • onDone

      public void onDone(V result)
      Description copied from interface: BackgroundTask.ProgressListener
      Provides exclusive access to this UI from outside a request handling thread when the task is completed.

      Please note that the command might be invoked on a different thread or later on the current thread, which means that custom thread locals might not have the expected values when the command is executed. UI.getCurrent(), VaadinSession.getCurrent() and VaadinService.getCurrent() are set according to this UI before executing the command. Other standard CurrentInstance values such as VaadinService.getCurrentRequest() and VaadinService.getCurrentResponse() will not be defined.

      Specified by:
      onDone in interface BackgroundTask.ProgressListener<T,V>
      Parameters:
      result - result of execution returned by BackgroundTask.run(TaskLifeCycle) method
      See Also:
      • UI.access(Command)
    • onCancel

      public void onCancel()
      Description copied from interface: BackgroundTask.ProgressListener
      Provides exclusive access to this UI from outside a request handling thread when the task is canceled by BackgroundTaskHandler.cancel() invocation.

      This method is not called in case of timeout expiration or owner view closing.

      Please note that the command might be invoked on a different thread or later on the current thread, which means that custom thread locals might not have the expected values when the command is executed. UI.getCurrent(), VaadinSession.getCurrent() and VaadinService.getCurrent() are set according to this UI before executing the command. Other standard CurrentInstance values such as VaadinService.getCurrentRequest() and VaadinService.getCurrentResponse() will not be defined.

      Specified by:
      onCancel in interface BackgroundTask.ProgressListener<T,V>
      See Also:
      • UI.access(Command)