BackgroundJob<T>public class WeightedBackgroundJob<T> extends Object implements BackgroundJob<T>
| Constructor | Description |
|---|---|
WeightedBackgroundJob(BackgroundJob<T> decoratedJob,
int weight) |
| Modifier and Type | Method | Description |
|---|---|---|
String |
getDescription() |
Describe the job.
|
int |
getWeight() |
|
T |
work(BackgroundJobMonitor monitor) |
Execute the Job.
|
public WeightedBackgroundJob(BackgroundJob<T> decoratedJob, int weight)
public T work(BackgroundJobMonitor monitor) throws Exception
BackgroundJobBackgroundJobMonitor to communicate with the scheduler:
BackgroundJobMonitor
through the BackgroundJobMonitor.announceTotal(int),
BackgroundJobMonitor.reportProgressAbsolute(int) and
BackgroundJobMonitor.reportProgressIncrement(int) methods.BackgroundJobMonitor.log(org.evolvis.tartools.backgroundjobs.BackgroundJobMonitor.Severity, Object)
Method.BackgroundJobMonitor.isAborting() property, to check whether a
cancellation was requested. If this is the case, this method should
return as quickly as possible.BackgroundJobMonitor.getScheduledJobId() Method.work in interface BackgroundJob<T>monitor - The job monitor that should be used to communicate with the
scheduler.Exception - The scheduler should be prepared to deal with any kind of
exception by marking the job as failed.public String getDescription()
BackgroundJobgetDescription in interface BackgroundJob<T>public int getWeight()
Copyright © 2018 tarent solutions GmbH, Germany. All rights reserved.