de.esprit.netsuite.rtask

## Interface RemoteTask<S extends ServerContext>

- All Superinterfaces:
    ApplicationObject<S>, AsyncExecutable<S>, AsyncTask<S>, CancellableTask, Dumpable, Executable, LocalCancellableTask, RemoteCancellableTask, java.lang.Runnable, ServerObject<S>, SimpleLogSupport, TaskIdHolder, TaskMonitorSupport
  All Known Subinterfaces:
    JournalTask<S>
  All Known Implementing Classes:
    AbstractBatchTask, AbstractDatabaseBatchTask, AbstractJournalOsProcessTask, AbstractJournalTask, AbstractRemoteOsProcessTask, AbstractRemoteTask, AgentExecutorTask, CoServerBindTask, LogCleanupBatchTask, RemoteArchiveExtractTask, RemoteArchiveListTask, RemoteJavaCommandTask, TestBatchTask

      public interface RemoteTask<S extends ServerContext>
      extends AsyncTask<S>, ServerObject<S>, RemoteCancellableTask

  This interface defines how a remote `AsyncTask` is being submitted to a pool. Note that a `RemoteTask` must be submitted with a `SessionId` and thus always knows who its owner is.
  Author:
    Rainer Buesch

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `SessionId` | `getOwnerSessionId()` Returns the `SessionId` of the session that owns this task.
    `RemoteRunStateFlag` | `getRunStateFlag()` Returns the `RemoteRunStateFlag` of this task
    `SessionId` | `getSessionId()` Returns the `SessionId` of the Session that submitted this task
    `RemoteTaskId` | `getTaskId()` Returns the `RemoteTaskId` of this task
    `RemoteTaskId` | `submit()` Submits this task for execution into the default application thread pool
    `RemoteTaskId` | `submit(java.util.concurrent.ExecutorService pool)` Submits this task for execution into the given thread pool

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

- - ### Method Detail

    - #### submit

          RemoteTaskId submit()
                              throws java.lang.Exception

      Submits this task for execution into the default application thread pool
      Specified by:
        `submit` in interface `AsyncTask<S extends ServerContext>`
      Throws:
        `java.lang.Exception` - if the pool is busy

    - #### submit

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

      Submits this task for execution into the given thread pool
      Specified by:
        `submit` in interface `AsyncTask<S extends ServerContext>`
      Throws:
        `java.lang.Exception` - if the pool is busy

    - #### getRunStateFlag

          RemoteRunStateFlag getRunStateFlag()

      Returns the `RemoteRunStateFlag` of this task
      Specified by:
        `getRunStateFlag` in interface `AsyncExecutable<S extends ServerContext>`

    - #### getTaskId

          RemoteTaskId getTaskId()

      Returns the `RemoteTaskId` of this task
      Specified by:
        `getTaskId` in interface `AsyncExecutable<S extends ServerContext>`
      Specified by:
        `getTaskId` in interface `TaskIdHolder`

    - #### getSessionId

          SessionId getSessionId()

      Returns the `SessionId` of the Session that submitted this task
      See Also:
        `getOwnerSessionId()`

    - #### getOwnerSessionId

          SessionId getOwnerSessionId()

      Returns the `SessionId` of the session that owns this task. Note the difference to `getSessionId()`. A task that runs i.e. in a `CoClientContext` might have the `SessionId` of that context. But the real owner-id of the task is the `SessionId` of the user that is logged in on the server!
      See Also:
        `getSessionId()`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.