public class FileTransferTask<C extends ClientContext,S extends ServerContext> extends AbstractClientTask<C>
FileTransferAgent
with the jobs addedchildTaskRef, isTestMode, monitorController, resultRef, stateFlag
Constructor and Description |
---|
FileTransferTask(C ctx) |
Modifier and Type | Method and Description |
---|---|
void |
addJob(FileTransferJob job)
Adds a
FileTransferJob to the underlying FileTransferAgent |
void |
cancel()
Flags the task as being cancelled.
|
void |
clearJobs() |
protected FileTransferAgent<C,S> |
createFileTransferAgent() |
void |
executeAsync()
Must be overridden to perform the async part.
|
FileTransferAgent<C,S> |
getAgent() |
int |
getJobCount() |
java.util.List<FileTransferJob> |
getJobList() |
void |
setTransferLocked(boolean isLocked) |
TaskId |
submit(java.util.concurrent.ExecutorService pool)
Submits this task for execution to the given thread pool
|
executeSubTask, getClientContext, getSessionId
awaitFinished, awaitFinished, awaitStarted, createTaskId, deregisterTask, doOnFinish, doOnStart, doOnSuccess, executeChildTask, executeChildTask, getCurrentFuture, getMaxChildTasks, getPriority, getProcessingDuration, getStartTime, getStopWatch, handleFinish, handleStart, handleSuccess, isRegisterForCancel, isRunning, notifyProceeded, registerTask, releaseStart, run, setCurrentFuture, setMaxChildTasks, setPriority, setRegisterForCancel, setReleaseTimeout, submit, submitInternal, toString, wasSucceeded
addMonitor, checkCancelled, checkForErrorAndRethrow, clearMonitors, createRunStateFlag, doOnCancel, doOnFailure, execute, executeSubTask, getError, getMaxProgressSteps, getMonitorCount, getMonitors, getName, getProgressStepCount, getResult, getRunStateFlag, getTaskId, 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
checkCancelled, checkForErrorAndRethrow, executeSubTask, getName, getResult, getRunStateFlag, getTaskId, getType, handleCancellation, handleFailure, isCancellable, 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
wasCancelled
getTaskId
toDumpString, toDumpString, toString
public FileTransferTask(C ctx)
public FileTransferAgent<C,S> getAgent()
protected FileTransferAgent<C,S> createFileTransferAgent()
public void executeAsync() throws java.lang.Exception
AbstractAsyncTask
AbstractAsyncTask.notifyProceeded(Object, int, int, String)
in order to notify
about task progress. Note: the running task should periodically call
AbstractAsyncExecutable.checkCancelled()
in order to detect cancellation.executeAsync
in interface AsyncExecutable<C extends ClientContext>
executeAsync
in class AbstractAsyncTask<C extends ClientContext>
java.lang.Exception
for synchronous execution
public void setTransferLocked(boolean isLocked)
public TaskId submit(java.util.concurrent.ExecutorService pool) throws java.lang.Exception
AsyncTask
submit
in interface AsyncTask<C extends ClientContext>
submit
in class AbstractAsyncTask<C extends ClientContext>
java.lang.Exception
- if the pool is busypublic void addJob(FileTransferJob job)
FileTransferJob
to the underlying FileTransferAgent
public int getJobCount()
public void clearJobs()
public java.util.List<FileTransferJob> getJobList()
public void cancel()
AbstractAsyncTask
AbstractAsyncExecutable.checkCancelled()
will
result a CancellationException
being thrown. As a result
AbstractAsyncExecutable.doOnCancel()
is being called on the task.cancel
in interface LocalCancellableTask
cancel
in class AbstractAsyncTask<C extends ClientContext>
Copyright © 2014 EsprIT-Systems. All Rights Reserved.