Interface RunningTask

All Superinterfaces:
CanRunSupplier, ConnIdOperationsListener, DebugDumpable, MappingStatisticsCollector, NotificationStatisticsCollector, ProgressCollector, RunningTaskStatisticsCollector, StatisticsCollector, Task, TaskActionsExecutedCollector, TaskIterativeOperationCollector, TaskSynchronizationStatisticsCollector
All Known Subinterfaces:
RunningLightweightTask

public interface RunningTask extends Task, RunningTaskStatisticsCollector, CanRunSupplier
A task that is directly used to execute the handler code. It is a very sensitive structure. First of all, it must be thread-safe because it is used for the handler code execution and at the same time accessed by clients that need to check its state. There are two such situations: (1) Lightweight Asynchronous Tasks because they have no persistent representation. The only instance that exists is the one that is being executed by a handler. (2) When a client asks the task manager for a current state of the task (typically being interested in operational stats). The information could be fetched from the repository but it would be a bit outdated. This situation can be avoided by retrieving information always from the repository, sacrificing information timeliness a bit. But the (1) cannot. Some information related to task execution (e.g. list of lightweight asynchronous tasks, information on task thread, etc) is relevant only for running tasks. Therefore they are moved here.
  • Method Details

    • createSubtask

      @NotNull @NotNull RunningLightweightTask createSubtask(@NotNull @NotNull LightweightTaskHandler handler)
      Creates a transient subtask, ready to execute a given LightweightTaskHandler. Owner is inherited from parent task to subtask.
    • getLightweightAsynchronousSubtasks

      Collection<? extends RunningLightweightTask> getLightweightAsynchronousSubtasks()
    • getRunningLightweightAsynchronousSubtasks

      Collection<? extends RunningLightweightTask> getRunningLightweightAsynchronousSubtasks()
    • getRunnableOrRunningLightweightAsynchronousSubtasks

      Collection<? extends RunningLightweightTask> getRunnableOrRunningLightweightAsynchronousSubtasks()
    • deleteLightweightAsynchronousSubtasks

      void deleteLightweightAsynchronousSubtasks()
      Precondition: there are no runnable nor running LATs
    • getRootTaskOid

      @Experimental @NotNull @NotNull String getRootTaskOid()
      TODO
    • getRootTask

      @Experimental @NotNull @NotNull Task getRootTask()
      TODO EXPERIMENTAL
    • getParentTask

      @Experimental @Nullable @Nullable Task getParentTask()
    • makeWaitingForOtherTasks

      void makeWaitingForOtherTasks(TaskUnpauseActionType unpauseAction)
      Changes scheduling status to WAITING. Does not change execution state. Currently use only on transient tasks OR from within task handler.
    • makeWaitingForOtherTasks

      void makeWaitingForOtherTasks(TaskExecutionStateType execState, TaskUnpauseActionType unpauseAction)
      Changes scheduling status to WAITING, and execution state to the given value. Currently use only on transient tasks OR from within task handler.
    • getActivityExecutionMode

      @Experimental @NotNull default @NotNull ExecutionModeType getActivityExecutionMode()
      Returns the execution mode (e.g. execute, simulate, dry run) for the current operation. This is a little hack to avoid the need of passing this information throughout the whole call tree. (Originally this was implemented in task extension.)
    • getExecutionSupport

      ExecutionSupport getExecutionSupport()
      Specified by:
      getExecutionSupport in interface Task
    • setExecutionSupport

      void setExecutionSupport(ExecutionSupport executionContext)
    • isExcludedFromStalenessChecking

      boolean isExcludedFromStalenessChecking()
      Returns:
      True if this task should not be checked for staleness.
    • setExcludedFromStalenessChecking

      void setExcludedFromStalenessChecking(boolean value)
      Sets the "excluded from staleness checking" flag.