Interface TaskListener

  • public interface TaskListener
    Notifies external observers about task-related events. These methods are executed from within the task execution thread, so they have to finish as quickly as possible. For the difference between task start/finish and task thread start/finish, please see
    • Method Detail

      • onTaskStart

        void onTaskStart​(Task task,
                         OperationResult result)
        Called when a task execution routine (i.e. task handler) starts. Task handler URI can be determined via task.getHandlerUri() method.
        task - task that is about to be started
      • onTaskFinish

        void onTaskFinish​(Task task,
                          TaskRunResult runResult,
                          OperationResult result)
        Called when a task execution routine (i.e. task handler) finishes. Please note that execution-related task attributes, like task's operation result, last task run finish timestamp, are NOT updated when this routine is called. These values have to be got from runResult parameter.
        task - task that was just finished
        runResult - result of the task's run
      • onTaskThreadStart

        void onTaskThreadStart​(Task task,
                               boolean isRecovering,
                               OperationResult result)
        Called when a task's execution thread is started.
        task - task whose thread was started
        isRecovering - true if the task was recovering from previous nodefailure
      • onTaskThreadFinish

        void onTaskThreadFinish​(Task task,
                                OperationResult result)
        Called when task's execution thread is finishing
        task - task whose thread is finishing