Class LocalizedTaskWrapper<T,V>

java.lang.Object
io.jmix.ui.executor.BackgroundTask<T,V>
io.jmix.ui.executor.LocalizedTaskWrapper<T,V>

public class LocalizedTaskWrapper<T,V> extends BackgroundTask<T,V>
  • Field Details

  • Constructor Details

  • Method Details

    • getParams

      public Map<String,Object> getParams()
      Description copied from class: BackgroundTask
      Called by the execution environment in UI thread to prepare some execution parameters. These parameters can be requested by the working thread inside the BackgroundTask.run(TaskLifeCycle) method by calling TaskLifeCycle.getParams().
      Overrides:
      getParams in class BackgroundTask<T,V>
      Returns:
      parameters map or null if parameters are not needed
    • run

      public V run(TaskLifeCycle<T> lifeCycle) throws Exception
      Description copied from class: BackgroundTask
      Main method that performs a task.
      Called by the execution environment in a separate working thread.
      Implementation of this method should support interruption:
      Specified by:
      run in class BackgroundTask<T,V>
      Parameters:
      lifeCycle - lifecycle object that allows the main method to interact with the execution environment
      Returns:
      task result
      Throws:
      Exception - exception in working thread
    • handleException

      public boolean handleException(Exception ex)
      Description copied from class: BackgroundTask
      Called by the execution environment in UI thread if the task BackgroundTask.run(TaskLifeCycle) method raised an exception.
      Overrides:
      handleException in class BackgroundTask<T,V>
      Parameters:
      ex - exception
      Returns:
      true if this method implementation actually handles the exception. Used for chaining handlers.
    • handleTimeoutException

      public boolean handleTimeoutException()
      Description copied from class: BackgroundTask
      Called by the execution environment in UI thread if the task timeout is exceeded.
      Overrides:
      handleTimeoutException in class BackgroundTask<T,V>
      Returns:
      true if this method implementation actually handles this event. Used for chaining handlers.
    • done

      public void done(V result)
      Description copied from class: BackgroundTask
      Called by the execution environment in UI thread when the task is completed.
      Overrides:
      done in class BackgroundTask<T,V>
      Parameters:
      result - result of execution returned by BackgroundTask.run(TaskLifeCycle) method
    • canceled

      public void canceled()
      Description copied from class: BackgroundTask
      Called by the execution environment in UI thread if the task is canceled by BackgroundTaskHandler.cancel() invocation.
      This method is not called in case of timeout expiration or owner window closing.
      Overrides:
      canceled in class BackgroundTask<T,V>
    • progress

      public void progress(List<T> changes)
      Description copied from class: BackgroundTask
      Called by the execution environment in UI thread on progress change.
      Overrides:
      progress in class BackgroundTask<T,V>
      Parameters:
      changes - list of changes since previous invocation
    • getScreenContext

      protected ScreenContext getScreenContext()
    • showExecutionError

      protected void showExecutionError(Exception ex)