V - public interface BackgroundJob<V>
BackgroundJobScheduler.
This interface models the “inside” part of the contract that is to be
fulfilled by the code implementing a particular job.
To schedule a job, use BackgroundJobScheduler.schedule(BackgroundJob)
or BackgroundJobScheduler.schedule(String, BackgroundJob).
See also: BackgroundJobInfo, BackgroundJobScheduler,
BackgroundJobStatus| Modifier and Type | Method and Description |
|---|---|
String |
getDescription()
Describe the job.
|
V |
work(BackgroundJobMonitor monitor)
Execute the Job.
|
V work(BackgroundJobMonitor monitor) throws Exception
BackgroundJobMonitor 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.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.String getDescription()
Copyright © 2018. All Rights Reserved.