de.esprit.appsuite.task.monitor

## Class TaskMonitorList

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.appsuite.launch.AbstractApplicationObject<C>
    - - de.esprit.appsuite.task.monitor.AbstractTaskMonitor
      - - de.esprit.appsuite.task.monitor.TaskMonitorList

- All Implemented Interfaces:
    ApplicationObject, TaskMonitor, SimpleLogSupport, Dumpable

      public class TaskMonitorList
      extends AbstractTaskMonitor

  This is a `TaskMonitor` implementation that actually manages a list of `TaskMonitor`s. This class makes it possible to attach multiple `TaskMonitor`s to a single `AsyncTask`. It forwards all notifications to all containing instances.
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TaskMonitorList(ApplicationContext ctx)`
    `TaskMonitorList(ApplicationContext ctx, LogChannel logCh)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addMonitor(TaskMonitor monitor)`
    `void` | `clearMonitors()`
    `int` | `getMonitorCount()`
    `TaskMonitor[]` | `getMonitors()`
    `boolean` | `hasMonitor()`
    `void` | `removeMonitor(TaskMonitor monitor)`
    `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 class de.esprit.appsuite.task.monitor.AbstractTaskMonitor

      `accept`

    - ### Methods inherited from class de.esprit.appsuite.launch.AbstractApplicationObject

      `getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel`

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

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

      `getApplicationContext`

- - ### Constructor Detail

    - #### TaskMonitorList

          public TaskMonitorList(ApplicationContext ctx)

    - #### TaskMonitorList

          public TaskMonitorList(ApplicationContext ctx,
                         LogChannel logCh)

  - ### Method Detail

    - #### taskStarted

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

      Description copied from interface: `TaskMonitor`
      Called when the async task started
      Throws:
        `java.lang.Exception`

    - #### taskProceeded

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

      Description copied from interface: `TaskMonitor`
      Is called on task progress.
        `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`

    - #### taskSucceeded

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

      Description copied from interface: `TaskMonitor`
      Called when the async task succeeded

    - #### taskCancelled

          public void taskCancelled(RunStateFlag stateFlag)

      Description copied from interface: `TaskMonitor`
      Called when the async task has discovered that it was cancelled

    - #### taskFailed

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

      Description copied from interface: `TaskMonitor`
      Called when the async task failed

    - #### taskFinished

          public void taskFinished(RunStateFlag stateFlag)

      Description copied from interface: `TaskMonitor`
      Called when the async task finished

    - #### taskChildStarted

          public void taskChildStarted(RunStateFlag stateFlag)

      Description copied from interface: `TaskMonitor`
      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

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

      Description copied from interface: `TaskMonitor`
      Indicates that a child task has been succeeded with the given result.

    - #### taskChildFinished

          public void taskChildFinished(RunStateFlag stateFlag)

      Description copied from interface: `TaskMonitor`
      Indicates that a child task has been finished.

    - #### addMonitor

          public void addMonitor(TaskMonitor monitor)

    - #### removeMonitor

          public void removeMonitor(TaskMonitor monitor)

    - #### clearMonitors

          public void clearMonitors()

    - #### getMonitors

          public TaskMonitor[] getMonitors()

    - #### getMonitorCount

          public int getMonitorCount()

    - #### hasMonitor

          public boolean hasMonitor()

Copyright © 2014 EsprIT-Systems. All Rights Reserved.