Class CompositeBackgroundJob.SubJobMonitor
java.lang.Object
org.evolvis.tartools.backgroundjobs.CompositeBackgroundJob.SubJobMonitor
- All Implemented Interfaces:
BackgroundJobMonitor
- Enclosing class:
- CompositeBackgroundJob
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.evolvis.tartools.backgroundjobs.BackgroundJobMonitor
BackgroundJobMonitor.Severity -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidannounceTotal(int totalItems) Announce the total amount of work to be done.Get the identifier assigned to theBackgroundJobby the scheduler.booleanWhether the cancellation of the job was requested.voidlog(BackgroundJobMonitor.Severity severity, Object message) write to the (job-specific) log.voidreportProgressAbsolute(int items) Report units of work completed since the begining of the job.voidreportProgressIncrement(int items) Report units of work completed since the last progress report.
-
Constructor Details
-
SubJobMonitor
-
-
Method Details
-
getScheduledJobId
Description copied from interface:BackgroundJobMonitorGet the identifier assigned to theBackgroundJobby the scheduler.
This ID uniquely identifies the job instance among all jobs managed by the scheduler. Since a single job instance is never executed more than once, it equivalently identifies that particular execution.- Specified by:
getScheduledJobIdin interfaceBackgroundJobMonitor- Returns:
- the id.
-
log
Description copied from interface:BackgroundJobMonitorwrite to the (job-specific) log.- Specified by:
login interfaceBackgroundJobMonitor
-
announceTotal
public void announceTotal(int totalItems) Description copied from interface:BackgroundJobMonitorAnnounce the total amount of work to be done.
TheBackgroundJobshould call this method at the beginning of its execution, as soon as it knows what lies ahead. It is ok to call this method multiple times with different values to update an initial assessment as new/more detailed information about the work to be done becomes available.- Specified by:
announceTotalin interfaceBackgroundJobMonitor- Parameters:
totalItems- the total units of work to be done.
-
reportProgressIncrement
public void reportProgressIncrement(int items) Description copied from interface:BackgroundJobMonitorReport units of work completed since the last progress report.
TheBackgroundJobcan use this method to report relative increments.- Specified by:
reportProgressIncrementin interfaceBackgroundJobMonitor- Parameters:
items- number of units of work completed since the last call.
-
reportProgressAbsolute
public void reportProgressAbsolute(int items) Description copied from interface:BackgroundJobMonitorReport units of work completed since the begining of the job.
TheBackgroundJobcan use this method to report the absolute amount of work that was tackled since the execution started.- Specified by:
reportProgressAbsolutein interfaceBackgroundJobMonitor- Parameters:
items- number of units of work completed since execution started.
-
isAborting
public boolean isAborting()Description copied from interface:BackgroundJobMonitorWhether the cancellation of the job was requested.
When true is returned, the scheduler has already tried set the interrupt flag on the thread executing the job.BackgroundJobs should poll this method in regular intervals and exit as quickly as possible if true is returned.- Specified by:
isAbortingin interfaceBackgroundJobMonitor- Returns:
- true, if the job should abort its execution.
-