public abstract class AbstractJournalTask<S extends ServerContext> extends AbstractRemoteTask<S> implements JournalTask<S>
RemoteTask
a JournalTask
continues running on the server after a client disconnect.
On client reconnect the task is reattached to the client and will run under client control as before. In order to
make this possible the journal task stores it's RemoteTaskEvent
s in a JournalTaskMonitor
and replays them on a client reconnect.childTaskRef, isTestMode, monitorController, resultRef, stateFlag
Constructor and Description |
---|
AbstractJournalTask(S serverCtx,
LogChannel logCh,
RemoteTaskType taskType,
SessionId sessionId) |
AbstractJournalTask(S serverCtx,
LogChannel logCh,
java.lang.String taskName,
RemoteTaskType taskType,
SessionId sessionId) |
AbstractJournalTask(S serverCtx,
SessionId sessionId) |
AbstractJournalTask(S serverCtx,
java.lang.String taskName,
RemoteTaskType taskType,
SessionId sessionId) |
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.
|
protected JournalTaskMonitor |
createTaskMonitor() |
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
|
addMonitor, cancel, createRunStateFlag, getKillerSessionId, getOwnerSessionId, getRunStateFlag, getSessionId, setSessionId
executeSubTask, getServerContext
awaitFinished, awaitFinished, awaitStarted, cancel, deregisterTask, doOnFinish, doOnStart, doOnSuccess, executeAsync, 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
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
getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel
configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setSessionId
getOwnerSessionId, getRunStateFlag, getSessionId
awaitFinished, awaitFinished, awaitStarted, executeChildTask, executeChildTask, getError, getProcessingDuration, hasError, isRegisterForCancel, isRunning, releaseStart, setName, setReleaseTimeout
checkCancelled, checkForErrorAndRethrow, executeAsync, executeSubTask, getName, getResult, getType, handleCancellation, handleFailure, isCancellable, notifyProceeded, setCancellable, setName, setResult, setRunStateFlag, sleepChecked
getApplicationContext
execute
addMonitor, clearMonitors, getMonitorCount, getMonitors, hasMonitor, removeMonitor
getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel
cancel
wasCancelled
toDumpString, toDumpString, toString, toString
getServerContext
cancel, getKillerSessionId
public AbstractJournalTask(S serverCtx, LogChannel logCh, RemoteTaskType taskType, SessionId sessionId)
public AbstractJournalTask(S serverCtx, LogChannel logCh, java.lang.String taskName, RemoteTaskType taskType, SessionId sessionId)
public AbstractJournalTask(S serverCtx, java.lang.String taskName, RemoteTaskType taskType, SessionId sessionId)
public JournalTaskId submit(java.util.concurrent.ExecutorService pool) throws java.lang.Exception
AsyncTask
submit
in interface AsyncTask<S extends ServerContext>
submit
in interface RemoteTask<S extends ServerContext>
submit
in class AbstractRemoteTask<S extends ServerContext>
java.lang.Exception
- if the pool is busypublic JournalTaskId submit() throws java.lang.Exception
AsyncTask
submit
in interface AsyncTask<S extends ServerContext>
submit
in interface RemoteTask<S extends ServerContext>
submit
in class AbstractRemoteTask<S extends ServerContext>
java.lang.Exception
- if the pool is busyprotected final JournalTaskId createTaskId()
AbstractAsyncTask
TaskId
which
is added to the RunStateFlag
.createTaskId
in class AbstractRemoteTask<S extends ServerContext>
public JournalTaskId getTaskId()
AsyncExecutable
TaskId
is used to model the task-hierarchy in a RunStateFlag
.
For AsyncExecutable
s it's always an instance of PseudoTaskId
.getTaskId
in interface AsyncExecutable<S extends ServerContext>
getTaskId
in interface TaskIdHolder
getTaskId
in interface JournalTask<S extends ServerContext>
getTaskId
in interface RemoteTask<S extends ServerContext>
getTaskId
in class AbstractRemoteTask<S extends ServerContext>
protected final JournalTaskMonitor createTaskMonitor()
createTaskMonitor
in class AbstractRemoteTask<S extends ServerContext>
public final JournalTaskMonitor getJournalMonitor()
getJournalMonitor
in interface JournalTask<S extends ServerContext>
public final void attachAndPlayEventJournal(SessionId sessionId)
JournalTask
JournalTask
and forces it to sent all stored and future events
to the given session.attachAndPlayEventJournal
in interface JournalTask<S extends ServerContext>
Copyright © 2014 EsprIT-Systems. All Rights Reserved.