org.bitrepository.service.workflow
Class JobTimerTask

java.lang.Object
  extended by java.util.TimerTask
      extended by org.bitrepository.service.workflow.JobTimerTask
All Implemented Interfaces:
Runnable

public class JobTimerTask
extends TimerTask

A timer task encapsulating a workflow. Used for scheduling workflows to run continuously at a given interval.


Constructor Summary
JobTimerTask(long interval, SchedulableJob job, List<JobEventListener> jobListeners)
          Initialise trigger.
 
Method Summary
 String getDescription()
           
 long getIntervalBetweenRuns()
           
 String getName()
           
 Date getNextRun()
           
 JobID getWorkflowID()
           
 void run()
           
 String runJob()
          Runs the job.
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobTimerTask

public JobTimerTask(long interval,
                    SchedulableJob job,
                    List<JobEventListener> jobListeners)
Initialise trigger.

Parameters:
interval - The interval between triggering events in milliseconds.
job: - The job.
Method Detail

getNextRun

public Date getNextRun()
Returns:
The date for the next time the encapsulated workflow should run.

getIntervalBetweenRuns

public long getIntervalBetweenRuns()
Returns:
The interval between the runs in millis.

getDescription

public String getDescription()

runJob

public String runJob()
Runs the job. Resets the date for the next run of the job.

Returns:
String

getName

public String getName()
Returns:
The name of the job.

getWorkflowID

public JobID getWorkflowID()

run

public void run()
Specified by:
run in interface Runnable
Specified by:
run in class TimerTask


Copyright © 2010-2013 The State and University Library, The Royal Library and The State Archives, Denmark. All Rights Reserved.