T - BackgroundJobInfoBackgroundJobStatusDecoratorpublic interface BackgroundJobStatus<T> extends BackgroundJobInfo
BackgroundJob.
BackgroundJobInfo contract by adding
methods to abort() or join(long) a scheduled job, and to
obtain its result() once it is done.BackgroundJobInfo.State| Modifier and Type | Method | Description |
|---|---|---|
void |
abort() |
Request the cancellation of a job.
|
void |
addJobListener(JobListener l) |
|
void |
join(long timeout) |
Join the thread executing the job.
|
void |
removeJobListener(JobListener l) |
|
T |
result() |
Obtain the result produced by the job, waiting for its completion if necessary.
|
getDescription, getId, getJobClass, getLastModified, getStartTime, getState, getWorkDone, getWorkTotalvoid abort()
BackgroundJobMonitor.isAborting() return false.
Nevertheless it may take some time until the job actually stops whatever it is doing.void join(long timeout) throws InterruptedException
timeout - the maximum number of milliseconds to wait for the job.InterruptedExceptionT result() throws InterruptedException, ExecutionException
InterruptedExceptionExecutionExceptionvoid addJobListener(JobListener l)
void removeJobListener(JobListener l)
Copyright © 2018 tarent solutions GmbH, Germany. All rights reserved.