de.esprit.netsuite.rtask.journal

## Class AbstractJournalOsProcessTask<S extends ServerContext>

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.appsuite.launch.AbstractApplicationObject<C>
    - - de.esprit.appsuite.task.AbstractAsyncExecutable<C>
      - - de.esprit.appsuite.task.AbstractAsyncTask<C>
        - - de.esprit.appsuite.task.osproc.AbstractOsProcessTask<S>
          - - de.esprit.netsuite.rtask.AbstractRemoteOsProcessTask<S>
            - - de.esprit.netsuite.rtask.journal.AbstractJournalOsProcessTask<S>

- All Implemented Interfaces:
    ApplicationObject<S>, AsyncExecutable<S>, AsyncTask<S>, CancellableTask, LocalCancellableTask, TaskMonitorSupport, TaskIdHolder, SimpleLogSupport, Dumpable, Executable, JournalTask<S>, RemoteCancellableTask, RemoteTask<S>, ServerObject<S>, java.lang.Runnable

      public abstract class AbstractJournalOsProcessTask<S extends ServerContext>
      extends AbstractRemoteOsProcessTask<S>
      implements JournalTask<S>

  This is a OS-process task that runs as a reattachable `JournalTask`
  Author:
    Thomas Stecher, Rainer Buesch

- - ### Field Summary

    - ### Fields inherited from class de.esprit.appsuite.task.osproc.AbstractOsProcessTask

      `OUTPUT_TYPE_CONSOLE`

    - ### Fields inherited from class de.esprit.appsuite.task.AbstractAsyncExecutable

      `childTaskRef, isTestMode, monitorController, resultRef, stateFlag`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractJournalOsProcessTask(S serverCtx, LogChannel logCh, java.lang.String taskName, RemoteTaskType taskType, SessionId sessionId)`
    `AbstractJournalOsProcessTask(S serverCtx, SessionId sessionId)`
    `AbstractJournalOsProcessTask(S serverCtx, java.lang.String taskName, SessionId sessionId)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `attachAndPlayEventJournal(SessionId sessionId)` Re-attaches to the `JournalTask` and forces it to sent all stored and future events to the given session.
    `protected JournalTaskId` | `createTaskId()` Is called at submit time.
    `JournalTaskMonitor` | `getJournalMonitor()`
    `JournalTaskId` | `getTaskId()` Returns an identifier object for this task.
    `JournalTaskId` | `submit()` Submits this task for execution to the default application thread pool
    `JournalTaskId` | `submit(java.util.concurrent.ExecutorService pool)` Submits this task for execution to the given thread pool

    - ### Methods inherited from class de.esprit.netsuite.rtask.AbstractRemoteOsProcessTask

      `cancel, createRunStateFlag, createTaskMonitor, doOnStart, getKillerSessionId, getOwnerSessionId, getRunStateFlag, getServerContext, getSessionId, setSessionId`

    - ### Methods inherited from class de.esprit.appsuite.task.osproc.AbstractOsProcessTask

      `cancel, checkExitStatus, createStandardInput, createStandardOutput, createStandardOutputFile, doOnConsoleOutput, doOnFileSystemChange, doOnFinish, executeAsync, getCommandBaseName, getCommandString, getProcessBuilder, getStandardOutputFile, getWorkingDir, isNotifyConsoleOutput, putEnv, setCommand, setNotifyConsoleOutput, setNotifyFileSystemChange, setStandardOutputFile, setWorkingDir, toDumpString`

    - ### Methods inherited from class de.esprit.appsuite.task.AbstractAsyncTask

      `awaitFinished, awaitFinished, awaitStarted, deregisterTask, doOnSuccess, executeChildTask, executeChildTask, getCurrentFuture, getMaxChildTasks, getPriority, getProcessingDuration, getStartTime, getStopWatch, handleFinish, handleStart, handleSuccess, isRegisterForCancel, isRunning, notifyProceeded, registerTask, releaseStart, run, setCurrentFuture, setMaxChildTasks, setPriority, setRegisterForCancel, setReleaseTimeout, submitInternal, toString, wasSucceeded`

    - ### Methods inherited from class de.esprit.appsuite.task.AbstractAsyncExecutable

      `addMonitor, checkCancelled, checkForErrorAndRethrow, clearMonitors, doOnCancel, doOnFailure, execute, executeSubTask, getError, getMaxProgressSteps, getMonitorCount, getMonitors, getName, getProgressStepCount, getResult, getType, handleCancellation, handleFailure, hasError, hasMonitor, isCancellable, registerTaskStateChange, removeMonitor, resetProgress, setCancellable, setLogLevel, setMaxProgressSteps, setMonitor, setName, setName, setResult, setRunStateFlag, setTaskId, setType, shouldFireMonitor, sleepChecked, wasCancelled`

    - ### 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, toString`

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

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

    - ### Methods inherited from interface de.esprit.netsuite.rtask.journal.JournalTask

      `setSessionId`

    - ### Methods inherited from interface de.esprit.netsuite.rtask.RemoteTask

      `getOwnerSessionId, getRunStateFlag, getSessionId`

    - ### Methods inherited from interface de.esprit.appsuite.task.AsyncTask

      `awaitFinished, awaitFinished, awaitStarted, executeChildTask, executeChildTask, getError, getProcessingDuration, hasError, isRegisterForCancel, isRunning, releaseStart, setName, setReleaseTimeout`

    - ### Methods inherited from interface de.esprit.appsuite.task.AsyncExecutable

      `checkCancelled, checkForErrorAndRethrow, executeAsync, executeSubTask, getName, getResult, getType, handleCancellation, handleFailure, isCancellable, notifyProceeded, setCancellable, setName, setResult, setRunStateFlag, sleepChecked`

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

      `getApplicationContext`

    - ### Methods inherited from interface de.esprit.common.type.Executable

      `execute`

    - ### Methods inherited from interface de.esprit.appsuite.task.monitor.TaskMonitorSupport

      `addMonitor, clearMonitors, getMonitorCount, getMonitors, hasMonitor, removeMonitor`

    - ### Methods inherited from interface de.esprit.common.log.SimpleLogSupport

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

    - ### Methods inherited from interface java.lang.Runnable

      `run`

    - ### Methods inherited from interface de.esprit.appsuite.task.LocalCancellableTask

      `cancel`

    - ### Methods inherited from interface de.esprit.appsuite.task.CancellableTask

      `wasCancelled`

    - ### Methods inherited from interface de.esprit.common.type.Dumpable

      `toDumpString, toDumpString, toString, toString`

    - ### Methods inherited from interface de.esprit.netsuite.server.ServerObject

      `getServerContext`

    - ### Methods inherited from interface de.esprit.netsuite.rtask.RemoteCancellableTask

      `cancel, getKillerSessionId`

- - ### Constructor Detail

    - #### AbstractJournalOsProcessTask

          public AbstractJournalOsProcessTask(S serverCtx,
                                      SessionId sessionId)

    - #### AbstractJournalOsProcessTask

          public AbstractJournalOsProcessTask(S serverCtx,
                                      java.lang.String taskName,
                                      SessionId sessionId)

    - #### AbstractJournalOsProcessTask

          public AbstractJournalOsProcessTask(S serverCtx,
                                      LogChannel logCh,
                                      java.lang.String taskName,
                                      RemoteTaskType taskType,
                                      SessionId sessionId)

  - ### Method Detail

    - #### submit

          public JournalTaskId submit(java.util.concurrent.ExecutorService pool)
                               throws java.lang.Exception

      Description copied from interface: `AsyncTask`
      Submits this task for execution to the given thread pool
      Specified by:
        `submit` in interface `AsyncTask<S extends ServerContext>`
      Specified by:
        `submit` in interface `RemoteTask<S extends ServerContext>`
      Overrides:
        `submit` in class `AbstractRemoteOsProcessTask<S extends ServerContext>`
      Throws:
        `java.lang.Exception` - if the pool is busy

    - #### submit

          public JournalTaskId submit()
                               throws java.lang.Exception

      Description copied from interface: `AsyncTask`
      Submits this task for execution to the default application thread pool
      Specified by:
        `submit` in interface `AsyncTask<S extends ServerContext>`
      Specified by:
        `submit` in interface `RemoteTask<S extends ServerContext>`
      Overrides:
        `submit` in class `AbstractRemoteOsProcessTask<S extends ServerContext>`
      Throws:
        `java.lang.Exception` - if the pool is busy

    - #### createTaskId

          protected final JournalTaskId createTaskId()

      Description copied from class: `AbstractAsyncTask`
      Is called at submit time. Each submit of a task creates a new `TaskId` which is added to the `RunStateFlag`.
      Overrides:
        `createTaskId` in class `AbstractRemoteOsProcessTask<S extends ServerContext>`

    - #### getTaskId

          public JournalTaskId getTaskId()

      Description copied from interface: `AsyncExecutable`
      Returns an identifier object for this task. Note: The `TaskId` is used to model the task-hierarchy in a `RunStateFlag`. For `AsyncExecutable`s it's always an instance of `PseudoTaskId`.
      Specified by:
        `getTaskId` in interface `AsyncExecutable<S extends ServerContext>`
      Specified by:
        `getTaskId` in interface `TaskIdHolder`
      Specified by:
        `getTaskId` in interface `JournalTask<S extends ServerContext>`
      Specified by:
        `getTaskId` in interface `RemoteTask<S extends ServerContext>`
      Overrides:
        `getTaskId` in class `AbstractRemoteOsProcessTask<S extends ServerContext>`

    - #### getJournalMonitor

          public final JournalTaskMonitor getJournalMonitor()

      Specified by:
        `getJournalMonitor` in interface `JournalTask<S extends ServerContext>`

    - #### attachAndPlayEventJournal

          public final void attachAndPlayEventJournal(SessionId sessionId)

      Description copied from interface: `JournalTask`
      Re-attaches to the `JournalTask` and forces it to sent all stored and future events to the given session.
      Specified by:
        `attachAndPlayEventJournal` in interface `JournalTask<S extends ServerContext>`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.