BackgroundJobInfo, BackgroundJobStatus<T>public abstract class BackgroundJobStatusDecorator<T> extends Object implements BackgroundJobStatus<T>
BackgroundJobInfo.State| Modifier and Type | Field | Description |
|---|---|---|
protected BackgroundJobStatus<T> |
delegatee |
| Constructor | Description |
|---|---|
BackgroundJobStatusDecorator(BackgroundJobStatus<T> delegatee) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
abort() |
Request the cancellation of a job.
|
void |
addJobListener(JobListener l) |
|
protected BackgroundJobStatus<T> |
getDelegatee() |
|
String |
getDescription() |
The human-readable description for this job.
|
String |
getId() |
The unique identifier assigned to this job by the scheduler.
|
Class<?> |
getJobClass() |
The class implementing the actual work.
|
long |
getLastModified() |
|
long |
getStartTime() |
|
BackgroundJobInfo.State |
getState() |
|
int |
getWorkDone() |
Get the amount of work that is already done.
|
int |
getWorkTotal() |
Get the total amount of work.
|
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.
|
protected final BackgroundJobStatus<T> delegatee
public BackgroundJobStatusDecorator(BackgroundJobStatus<T> delegatee)
public BackgroundJobInfo.State getState()
getState in interface BackgroundJobInfoBackgroundJobInfo.State of the job.public int getWorkDone()
BackgroundJobInfoBackgroundJobInfo.getWorkTotal() to put this into relation.getWorkDone in interface BackgroundJobInfopublic int getWorkTotal()
BackgroundJobInfoBackgroundJob -implementations will typically provide a value in an early stage of
processing. They are however not obliged to do so, so the expected total
amount may not be known yet. In particular, BackgroundJob are
allowed to to update this value if new information about the total amount
of work to be done becomes available.getWorkTotal in interface BackgroundJobInfopublic void abort()
BackgroundJobStatusBackgroundJobMonitor.isAborting() return false.
Nevertheless it may take some time until the job actually stops whatever it is doing.abort in interface BackgroundJobStatus<T>public String getId()
BackgroundJobInfogetId in interface BackgroundJobInfopublic void join(long timeout)
throws InterruptedException
BackgroundJobStatusjoin in interface BackgroundJobStatus<T>timeout - the maximum number of milliseconds to wait for the job.InterruptedExceptionpublic String getDescription()
BackgroundJobInfogetDescription in interface BackgroundJobInfopublic T result() throws InterruptedException, ExecutionException
BackgroundJobStatusresult in interface BackgroundJobStatus<T>InterruptedExceptionExecutionExceptionpublic Class<?> getJobClass()
BackgroundJobInfoBackgroundJob, but Schedulers may choose a
different approach.getJobClass in interface BackgroundJobInfopublic void addJobListener(JobListener l)
addJobListener in interface BackgroundJobStatus<T>public void removeJobListener(JobListener l)
removeJobListener in interface BackgroundJobStatus<T>public long getLastModified()
getLastModified in interface BackgroundJobInfopublic long getStartTime()
getStartTime in interface BackgroundJobInfoprotected BackgroundJobStatus<T> getDelegatee()
Copyright © 2018 tarent solutions GmbH, Germany. All rights reserved.