de.esprit.netsuite.server.batch

## Class ServerBatchTaskMonitor<S extends ServerContext>

- 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<S>
        - - de.esprit.netsuite.server.batch.ServerBatchTaskMonitor<S>

- All Implemented Interfaces:
    ApplicationObject<S>, TaskMonitor<S>, SimpleLogSupport, Dumpable, ServerObject<S>

      public class ServerBatchTaskMonitor<S extends ServerContext>
      extends DefaultTaskMonitor<S>
      implements ServerObject<S>

  This Monitor is attached to `AbstractServerBatchTask` instances. It generates and sends `ServerBatchTaskEvent`s to registered clients in order to notify the progress of batch processes.
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServerBatchTaskMonitor(S serverCtx, AbstractServerBatchTask batchProc)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getName()`
    `S` | `getServerContext()` Returns the server runtime environment
    `void` | `taskCancelled(RunStateFlag stateFlag)` Called when the async task has discovered that it was cancelled
    `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.DefaultTaskMonitor

      `taskChildFinished, taskChildStarted, taskChildSucceeded`

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

    - #### ServerBatchTaskMonitor

          public ServerBatchTaskMonitor(S serverCtx,
                                AbstractServerBatchTask batchProc)

  - ### Method Detail

    - #### getServerContext

          public final S getServerContext()

      Description copied from interface: `ServerObject`
      Returns the server runtime environment
      Specified by:
        `getServerContext` in interface `ServerObject<S extends ServerContext>`

    - #### getName

          public java.lang.String getName()

    - #### taskStarted

          public void taskStarted(RunStateFlag stateFlag)

      Description copied from interface: `TaskMonitor`
      Called when the async task started
      Specified by:
        `taskStarted` in interface `TaskMonitor<S extends ServerContext>`
      Overrides:
        `taskStarted` in class `DefaultTaskMonitor<S extends ServerContext>`

    - #### taskProceeded

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

      Description copied from interface: `TaskMonitor`
      Is called on task progress.
      Specified by:
        `taskProceeded` in interface `TaskMonitor<S extends ServerContext>`
      Overrides:
        `taskProceeded` in class `DefaultTaskMonitor<S extends ServerContext>`
        `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)

    - #### taskSucceeded

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

      Description copied from interface: `TaskMonitor`
      Called when the async task succeeded
      Specified by:
        `taskSucceeded` in interface `TaskMonitor<S extends ServerContext>`
      Overrides:
        `taskSucceeded` in class `DefaultTaskMonitor<S extends ServerContext>`

    - #### taskCancelled

          public void taskCancelled(RunStateFlag stateFlag)

      Description copied from interface: `TaskMonitor`
      Called when the async task has discovered that it was cancelled
      Specified by:
        `taskCancelled` in interface `TaskMonitor<S extends ServerContext>`
      Overrides:
        `taskCancelled` in class `DefaultTaskMonitor<S extends ServerContext>`

    - #### taskFailed

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

      Description copied from interface: `TaskMonitor`
      Called when the async task failed
      Specified by:
        `taskFailed` in interface `TaskMonitor<S extends ServerContext>`
      Overrides:
        `taskFailed` in class `DefaultTaskMonitor<S extends ServerContext>`

    - #### taskFinished

          public void taskFinished(RunStateFlag stateFlag)

      Description copied from interface: `TaskMonitor`
      Called when the async task finished
      Specified by:
        `taskFinished` in interface `TaskMonitor<S extends ServerContext>`
      Overrides:
        `taskFinished` in class `DefaultTaskMonitor<S extends ServerContext>`

Copyright © 2013 EsprIT-Systems. All Rights Reserved.