01: package org.griphyn.cPlanner.selector.site;
02:
03: import org.griphyn.cPlanner.classes.SubInfo;
04:
05: import org.griphyn.cPlanner.partitioner.graph.Graph;
06: import org.griphyn.cPlanner.partitioner.graph.GraphNode;
07:
08: import java.util.List;
09: import java.util.Iterator;
10:
11: /**
12: * The base class for the site selectors that want to map one job at a time.
13: *
14: * @author Karan Vahi
15: * @version $Revision: 298 $
16: */
17: public abstract class AbstractPerJob extends Abstract {
18:
19: /**
20: * Maps the jobs in the workflow to the various grid sites.
21: *
22: * @param workflow the workflow in a Graph form.
23: * @param sites the list of <code>String</code> objects representing the
24: * execution sites that can be used.
25: *
26: */
27: public void mapWorkflow(Graph workflow, List sites) {
28: //iterate through the jobs in BFS
29: for (Iterator it = workflow.iterator(); it.hasNext();) {
30: GraphNode node = (GraphNode) it.next();
31: mapJob((SubInfo) node.getContent(), sites);
32: }
33:
34: }
35:
36: /**
37: * Maps a job in the workflow to the various grid sites.
38: *
39: * @param job the job to be mapped.
40: * @param sites the list of <code>String</code> objects representing the
41: * execution sites that can be used.
42: *
43: */
44: public abstract void mapJob(SubInfo job, List sites);
45:
46: }
|