de.esprit.appsuite.task

## Class DefaultTaskMonitor<C extends ApplicationContext>

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

- All Implemented Interfaces:
    ApplicationObject<C>, TaskMonitor<C>, SimpleLogSupport, Dumpable
  Direct Known Subclasses:
    AgentTaskMonitor, BatchTaskMonitor, DebugTaskMonitor, RemoteTaskHistoryMonitor

      public class DefaultTaskMonitor<C extends ApplicationContext>
      extends AbstractTaskMonitor<C>

  This is a `TaskMonitor` template with empty default implementations. You may override methods as needed. Be aware that all methods in this monitor are called async by the Thread that runs the underlying task.
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultTaskMonitor(C ctx)`
    `DefaultTaskMonitor(C ctx, LogChannel logCh)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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 obj, 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

    - #### DefaultTaskMonitor

          public DefaultTaskMonitor(C ctx,
                            LogChannel logCh)

    - #### DefaultTaskMonitor

          public DefaultTaskMonitor(C ctx)

  - ### 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 obj,
                           int step,
                           int maxSteps,
                           java.lang.String message)
                             throws java.lang.Exception

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

    - #### 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

    - #### taskSucceeded

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

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

    - #### 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.

Copyright © 2014 EsprIT-Systems. All Rights Reserved.