1
2
3
4
5
6
7
8
9
10
11 package org.astrogrid.jes.jobscheduler;
12 import org.astrogrid.jes.beans.v1.axis.executionrecord.JobURN;
13 import org.astrogrid.jes.types.v1.cea.axis.JobIdentifierType;
14 import org.astrogrid.jes.types.v1.cea.axis.ResultListType;
15 /*** Interface to a component that executes jobs.
16 * @author Noel Winstanley nw@jb.man.ac.uk 05-Mar-2004
17 *
18 */
19 public interface JobScheduler {
20 /*** register a new pending job with the scheduler.
21 * <p>
22 * This method doesn't itself start the job running - it merely notifies the scheduler of the existence of a new job. The scheduler is
23 * free to decide when and how to execute the job
24 * @param jobURN unique identifier of the workflow document that forms this job. It is assumed that the scheduler can use this to retreive the workflow definition
25 * from some store.
26 * @throws Exception catch all
27 */
28 public abstract void scheduleNewJob(JobURN jobURN) throws Exception;
29
30 /*** resume execution of a job
31 * <p>
32 * Called upon completion of the execution of a job step - whatever executes a job step calls this afterwards to notify the scheduler
33 * that the step is completed.
34 * <p>
35 * The scheduler is then expected to examine the results of the step execution, and possible schedule further steps for execution.
36 * @param id unique identifier for the job and step. details of encoding are privae to a particular scheduler implementation.
37 * @param info reporting information on the execution of the step.
38 * @throws Exception
39 */
40 public abstract void resumeJob(JobIdentifierType id, org.astrogrid.jes.types.v1.cea.axis.MessageType info) throws Exception;
41
42 /*** abort execution of a job
43 * <p>
44 * Leaves record of job in the store */
45 public abstract void abortJob(JobURN jobURN) throws Exception;
46
47 /*** delete all record of a job
48 * <p>
49 * aborts if still running, then deletes the job record from the store */
50 public abstract void deleteJob(JobURN jobURN) throws Exception;
51
52 /*** report results of a job step
53 *
54 * @param id unique id of the job and step
55 * @param results results information for this step.
56 * @throws Exception
57 */
58 public abstract void reportResults(JobIdentifierType id,ResultListType results) throws Exception;
59
60 }