de.esprit.appsuite.task.monitor

## Interface TaskMonitor<C extends ApplicationContext>

- All Superinterfaces:
    ApplicationObject<C>
  All Known Implementing Classes:
    AbstractTaskMonitor, AgentTaskMonitor, BatchTaskMonitor, DebugTaskMonitor, DefaultTaskMonitor, JournalTaskMonitor, RemoteTaskHistoryMonitor, RemoteTaskMonitor, SwingTaskMonitor, TaskMonitorList, WriterTaskMonitor

      public interface TaskMonitor<C extends ApplicationContext>
      extends ApplicationObject<C>

  This interface defines methods for being notified about task progress. Note that canceling the monitor in fact cancels the underlying task.
  Author:
    Rainer Buesch

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `accept(RunState state)` Tells whether the monitor wants to be notified about this `RunState`.
    `void` | `taskCancelled(RunStateFlag stateFlag)` Called when the async task has discovered that it was cancelled
    `void` | `taskChildFinished(RunStateFlag stateFlag)` Indicates that a child task has been finished.
    `void` | `taskChildStarted(RunStateFlag stateFlag)` Indicates that a child task has been started.
    `void` | `taskChildSucceeded(RunStateFlag stateFlag, java.lang.Object result)` Indicates that a child task has been succeeded with the given result.
    `void` | `taskFailed(RunStateFlag stateFlag, java.lang.Exception error)` Called when the async task failed
    `void` | `taskFinished(RunStateFlag stateFlag)` Called when the async task finished
    `void` | `taskProceeded(RunStateFlag stateFlag, java.lang.Object result, int step, int maxSteps, java.lang.String message)` Is called on task progress.
    `void` | `taskStarted(RunStateFlag stateFlag)` Called when the async task started
    `void` | `taskSucceeded(RunStateFlag stateFlag, java.lang.Object result)` Called when the async task succeeded

    - ### Methods inherited from interface de.esprit.appsuite.launch.ApplicationObject

      `getApplicationContext`

- - ### Method Detail

    - #### accept

          boolean accept(RunState state)

      Tells whether the monitor wants to be notified about this `RunState`.

    - #### taskStarted

          void taskStarted(RunStateFlag stateFlag)
                           throws java.lang.Exception

      Called when the async task started
      Throws:
        `java.lang.Exception`

    - #### taskSucceeded

          void taskSucceeded(RunStateFlag stateFlag,
                           java.lang.Object result)

      Called when the async task succeeded

    - #### taskCancelled

          void taskCancelled(RunStateFlag stateFlag)

      Called when the async task has discovered that it was cancelled

    - #### taskFailed

          void taskFailed(RunStateFlag stateFlag,
                        java.lang.Exception error)

      Called when the async task failed

    - #### taskFinished

          void taskFinished(RunStateFlag stateFlag)

      Called when the async task finished

    - #### taskProceeded

          void taskProceeded(RunStateFlag stateFlag,
                           java.lang.Object result,
                           int step,
                           int maxSteps,
                           java.lang.String message)
                             throws java.lang.Exception

      Is called on task progress.
      Parameters:
        `result` - may be anything the running task has produced (i.e. a DBRecord)
        `step` - the number of steps performed
        `maxSteps` - the maximum number of steps expected (0 if not known)
      Throws:
        `java.lang.Exception`

    - #### taskChildStarted

          void taskChildStarted(RunStateFlag stateFlag)

      Indicates that a child task has been started. Note that the child's taskId will be available from the RunState's taskId by `RunStateFlag.getCurrentChild()`;

    - #### taskChildSucceeded

          void taskChildSucceeded(RunStateFlag stateFlag,
                                java.lang.Object result)

      Indicates that a child task has been succeeded with the given result.

    - #### taskChildFinished

          void taskChildFinished(RunStateFlag stateFlag)

      Indicates that a child task has been finished.

Copyright © 2014 EsprIT-Systems. All Rights Reserved.