01: /**
02: * This file or a portion of this file is licensed under the terms of
03: * the Globus Toolkit Public License, found in file GTPL, or at
04: * http://www.globus.org/toolkit/download/license.html. This notice must
05: * appear in redistributions of this file, with or without modification.
06: *
07: * Redistributions of this Software, with or without modification, must
08: * reproduce the GTPL in: (1) the Software, or (2) the Documentation or
09: * some other similar material which is provided with the Software (if
10: * any).
11: *
12: * Copyright 1999-2004 University of Chicago and The University of
13: * Southern California. All rights reserved.
14: */package org.griphyn.cPlanner.transfer;
15:
16: import org.griphyn.cPlanner.classes.ADag;
17: import org.griphyn.cPlanner.classes.SubInfo;
18: import org.griphyn.cPlanner.classes.PlannerOptions;
19:
20: import org.griphyn.cPlanner.common.PegasusProperties;
21: import org.griphyn.cPlanner.common.LogManager;
22:
23: import org.griphyn.cPlanner.transfer.implementation.ImplementationFactory;
24: import org.griphyn.cPlanner.transfer.implementation.TransferImplementationFactoryException;
25:
26: import java.util.Collection;
27:
28: import java.io.IOException;
29:
30: import java.lang.reflect.InvocationTargetException;
31:
32: /**
33: * The refiner interface, that determines the functions that need to be
34: * implemented to add various types of transfer nodes to the workflow.
35: * The single in the name indicates that the refiner works with the
36: * implementation that handles one file transfer per transfer job.
37: *
38: * @author Karan Vahi
39: * @author Gaurang Mehta
40: *
41: * @version $Revision: 50 $
42: */
43: public abstract class SingleFTPerXFERJobRefiner extends AbstractRefiner {
44:
45: /**
46: * The overloaded constructor.
47: *
48: * @param dag the workflow to which transfer nodes need to be added.
49: * @param properties the <code>PegasusProperties</code> object containing all
50: * the properties required by Pegasus.
51: * @param options the options passed to the planner.
52: */
53: public SingleFTPerXFERJobRefiner(ADag dag,
54: PegasusProperties properties, PlannerOptions options) {
55: super (dag, properties, options);
56: }
57:
58: /**
59: * Loads the appropriate implementations that is required by this refinement
60: * strategy for different types of transfer jobs. It calls to the factory
61: * method to load the appropriate Implementor.
62: *
63: * Loads the implementing class corresponding to the mode specified by the user
64: * at runtime in the properties file. The properties object passed should not
65: * be null.
66: *
67: * @param properties the <code>PegasusProperties</code> object containing all
68: * the properties required by Pegasus.
69: * @param options the options with which the planner was invoked.
70: *
71: * @exception TransferImplementationFactoryException that nests any error that
72: * might occur during the instantiation.
73: */
74: public void loadImplementations(PegasusProperties properties,
75: PlannerOptions options)
76: throws TransferImplementationFactoryException {
77:
78: //this can work with any Implementation Factory
79: this .mTXStageInImplementation = ImplementationFactory
80: .loadInstance(properties, options,
81: ImplementationFactory.TYPE_STAGE_IN);
82: this .mTXStageInImplementation.setRefiner(this );
83: this .mTXInterImplementation = ImplementationFactory
84: .loadInstance(properties, options,
85: ImplementationFactory.TYPE_STAGE_INTER);
86: this .mTXInterImplementation.setRefiner(this );
87: this .mTXStageOutImplementation = ImplementationFactory
88: .loadInstance(properties, options,
89: ImplementationFactory.TYPE_STAGE_OUT);
90: this .mTXStageOutImplementation.setRefiner(this );
91: //log config messages message
92: super.logConfigMessages();
93:
94: }
95: }
|