org.bitrepository.service.scheduler
Interface JobScheduler

All Known Implementing Classes:
TimerbasedScheduler

public interface JobScheduler

Interface for scheduling jobs for services.


Method Summary
 void addJobEventListener(JobEventListener listener)
          Enables other objects to listen for job events.
 JobTimerTask cancelJob(JobID jobId)
          Cancels the workflow with the given name.
 Date getNextRun(JobID jobId)
          Return the date for the next run of the indicated workflow.
 long getRunInterval(JobID jobId)
          Returns the interval between runs for the indicated workflow.
 void schedule(SchedulableJob job, Long interval)
          Adds a job for the scheduler to schedule.
 String startJob(SchedulableJob job)
          Reschedules the job to start now,
 

Method Detail

schedule

void schedule(SchedulableJob job,
              Long interval)
Adds a job for the scheduler to schedule.

Parameters:
job - The jo to schedule.
interval - The interval for how often the workflow should be triggered.

cancelJob

JobTimerTask cancelJob(JobID jobId)
Cancels the workflow with the given name.

Parameters:
jobId - The ID of the workflow to cancelJob.
Returns:
The canceled JobTimerTask.

startJob

String startJob(SchedulableJob job)
Reschedules the job to start now,

Parameters:
job -
Returns:
A string indicating the result of the attempt to start the workflow.

getNextRun

Date getNextRun(JobID jobId)
Return the date for the next run of the indicated workflow. Return null if the workflow isn't scheduled.


getRunInterval

long getRunInterval(JobID jobId)
Returns the interval between runs for the indicated workflow. The interval is in milliseconds.


addJobEventListener

void addJobEventListener(JobEventListener listener)
Enables other objects to listen for job events.

Parameters:
listener - The callback listener to receive the events.


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