net.sourceforge.java.util.jobs.scheduling
Class ScheduledJob

java.lang.Object
  extended byjava.util.TimerTask
      extended bynet.sourceforge.java.util.jobs.scheduling.ScheduledJob
All Implemented Interfaces:
Runnable

public class ScheduledJob
extends TimerTask

Wraps an IJob for scheduled execution in the JobManager context.

Author:
Sebastian Machhausen

Field Summary
private  JobExecutionStatus executionStatus
           The execution status object of the ScheduledJob
private  IJob job
           The IJob scheduled for execution
private  IProgressMonitor monitor
           The IProgressMonitor to use for reporting the progress of the wrapped IJob
 
Fields inherited from class java.util.TimerTask
 
Constructor Summary
ScheduledJob(IJob job, IProgressMonitor monitor, JobExecutionStatus executionStatus)
           Creates a new ScheduledJob that wraps up the specified IJob for automated interval based execution according to the settings in the specified JobExecutionStatus.
 
Method Summary
 boolean cancel()
           Cancels this ScheduledJobby cancelling further executions.
 JobExecutionStatus getExecutionStatus()
           Gets the JobExceutionStatus of this ScheduledJob.
 void run()
           Executes the IJob wrapped up in this ScheduledJob by invoking the inherited IRunnableWithProgress.run(org.eclipse.core.runtime.IProgressMonitor) method.
 
Methods inherited from class java.util.TimerTask
scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

job

private IJob job

The IJob scheduled for execution


monitor

private IProgressMonitor monitor

The IProgressMonitor to use for reporting the progress of the wrapped IJob


executionStatus

private JobExecutionStatus executionStatus

The execution status object of the ScheduledJob

Constructor Detail

ScheduledJob

public ScheduledJob(IJob job,
                    IProgressMonitor monitor,
                    JobExecutionStatus executionStatus)

Creates a new ScheduledJob that wraps up the specified IJob for automated interval based execution according to the settings in the specified JobExecutionStatus.

Parameters:
job - the IJob to schedule for execution
monitor - the IProgressMonitor to use for reporting the progress of the specified IJob
executionStatus - the JobExecutionStatus for the specified IJob
Method Detail

getExecutionStatus

public JobExecutionStatus getExecutionStatus()

Gets the JobExceutionStatus of this ScheduledJob.

Returns:
the JobExceutionStatus of this ScheduledJob

cancel

public boolean cancel()

Cancels this ScheduledJobby cancelling further executions. If the wrapped IJob is currently running it is also canceled.


run

public void run()

Executes the IJob wrapped up in this ScheduledJob by invoking the inherited IRunnableWithProgress.run(org.eclipse.core.runtime.IProgressMonitor) method.