Class Job

All Implemented Interfaces:
InterruptableJob, Job
Direct Known Subclasses:
InterruptingJob

public abstract class Job extends JobContainer implements InterruptableJob
Author:
timmolter
  • Constructor Details

    • Job

      public Job()
      Required no-arg constructor
  • Method Details

    • execute

      public final void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException
      Description copied from interface: Job
      Called by the Scheduler when a Trigger fires that is associated with the Job.

      The implementation may wish to set a result object on the JobExecutionContext before this method exits. The result itself is meaningless to Quartz, but may be informative to JobListeners or TriggerListeners that are watching the job's execution.

      Specified by:
      execute in interface Job
      Throws:
      JobExecutionException - if there is an exception while executing the job.
    • interrupt

      public void interrupt()
      Description copied from interface: InterruptableJob
      Called by the Scheduler when a user interrupts the Job.
      Specified by:
      interrupt in interface InterruptableJob
    • setup

      public void setup()
      Override and place any code in here that should be called before doRun().
    • cleanup

      public void cleanup()
      Override and place any code in here that should be called no matter what after the Job runs or throws an exception. The JobContext is still available here.

      Unlike exceptions thrown from setup() or doRun(), which are caught and logged, an exception thrown from cleanup() propagates out of execute() to the scheduler.

    • doRun

      public abstract void doRun() throws JobInterruptException
      Throws:
      JobInterruptException