Interface BackgroundJobStatus<T>
- Type Parameters:
T-
- All Superinterfaces:
BackgroundJobInfo
- All Known Implementing Classes:
BackgroundJobStatusDecorator
A handle on a scheduled
This interface extends the
BackgroundJob.
This interface extends the
BackgroundJobInfo contract by adding
methods to abort() or join(long) a scheduled job, and to
obtain its result() once it is done.- Author:
- lukas
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.evolvis.tartools.backgroundjobs.BackgroundJobInfo
BackgroundJobInfo.State -
Method Summary
Methods inherited from interface org.evolvis.tartools.backgroundjobs.BackgroundJobInfo
getDescription, getId, getJobClass, getLastModified, getStartTime, getState, getWorkDone, getWorkTotal, isVisible
-
Method Details
-
abort
void abort()Request the cancellation of a job.
This will try to interrupt the thread executing the job and it will makeBackgroundJobMonitor.isAborting()return false. Nevertheless it may take some time until the job actually stops whatever it is doing. -
join
Join the thread executing the job.- Parameters:
timeout- the maximum number of milliseconds to wait for the job.- Throws:
InterruptedException
-
result
Obtain the result produced by the job, waiting for its completion if necessary.- Returns:
- the result.
- Throws:
InterruptedExceptionExecutionException
-
isCancellationSupported
boolean isCancellationSupported()Whether this job can be canceled.
- Returns:
- a
booleanindicating whether this job can be canceled once its execution has started. - Since:
- 1.21
- See Also:
-
addJobListener
-
removeJobListener
-