dk.netarkivet.harvester.scheduler
Class JobSupervisor

java.lang.Object
  extended by dk.netarkivet.harvester.scheduler.JobSupervisor
All Implemented Interfaces:
ComponentLifeCycle

public class JobSupervisor
extends java.lang.Object
implements ComponentLifeCycle

Responsible for cleaning obsolete jobs, see start() for details.


Constructor Summary
JobSupervisor()
           
 
Method Summary
(package private)  void cleanOldJobs()
          Stops any job that has been in status STARTED a very long time defined by the HarvesterSettings.JOB_TIMEOUT_TIME setting.
(package private)  void rescheduleLeftOverJobs()
          Reschedule all jobs with JobStatus SUBMITTED.
 void shutdown()
          The inverse of the start() method.
 void start()
           Starts the rescheduling of left over jobs (in a separate thread).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobSupervisor

public JobSupervisor()
Method Detail

start

public void start()
  1. Starts the rescheduling of left over jobs (in a separate thread).
  2. Starts the timer for cleaning old jobs. eg. jobs that have been run longer than HarvesterSettings.JOB_TIMEOUT_TIME.

Specified by:
start in interface ComponentLifeCycle

shutdown

public void shutdown()
Description copied from interface: ComponentLifeCycle
The inverse of the start() method. Contains functionality for deallocation of ressources, clearing data, closing connections, stopping threads, etc

Specified by:
shutdown in interface ComponentLifeCycle

rescheduleLeftOverJobs

void rescheduleLeftOverJobs()
Reschedule all jobs with JobStatus SUBMITTED. Runs in a separate thread to avoid blocking. Package protected to allow unit testing.


cleanOldJobs

void cleanOldJobs()
Stops any job that has been in status STARTED a very long time defined by the HarvesterSettings.JOB_TIMEOUT_TIME setting. Package protected to allow unit testing.