|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.isi.pegasus.planner.code.GridStartFactory
public class GridStartFactory
An abstract factory class to load the appropriate type of GridStart implementations, and their corresponding POSTScript classes. This factory class is different from other factories, in the sense that it must be instantiated first and intialized first before calling out to any of the Factory methods.
| Field Summary | |
|---|---|
static String |
ALL_POST_SCRIPT_SCOPE
The postscript mode in which post scripts are added only for all jobs. |
static String |
DEFAULT_PACKAGE_NAME
The package name where the implementations of this interface reside by default. |
static String |
ESSENTIAL_POST_SCRIPT_SCOPE
The postscript mode in which post scripts are added only for essential jobs. |
static String[] |
GRIDSTART_IMPLEMENTING_CLASSES
The known gridstart implementations. |
static String[] |
GRIDSTART_SHORT_NAMES
The corresponding short names for the implementations. |
static int |
KICKSTART_INDEX
The index in the constant arrays for NoGridStart. |
private PegasusBag |
mBag
The bag of objects used for initialization. |
private ADag |
mDAG
The workflow object. |
private Map |
mGridStartImplementationTable
A table that maps short names of GridStart implementations
with the implementations themselves. |
private boolean |
mInitialized
A boolean indicating that the factory has been initialized. |
private Map |
mPOSTScriptImplementationTable
A table that maps short names of POSTScript implementations
with the implementations themselves. |
private PegasusProperties |
mProps
The properties object holding all the properties. |
private String |
mSubmitDir
The submit directory where the submit files are being generated for the workflow. |
static int |
NO_GRIDSTART_INDEX
The index in the constant arrays for NoGridStart. |
private static Map |
POSTSCRIPT_IMPLEMENTING_CLASS_TABLE
A table that associates POSTScript implementing classes with their SHORT_NAMES. |
static int |
SEQEXEC_INDEX
The index in constant arrays for SeqExec |
| Constructor Summary | |
|---|---|
GridStartFactory()
The default constructor. |
|
| Method Summary | |
|---|---|
private static void |
associate(POSTScript ps)
Associates a shortname with the classname. |
private static void |
associate(String shortName,
String className)
Associates a shortname with the classname. |
private GridStart |
gridStart(String name)
Returns the cached implementation of GridStart from the implementing class table. |
private static String |
implementingPOSTScriptClass(String shortName)
Returns the name of the implementing POSTSCript class. |
void |
initialize(PegasusBag bag,
ADag dag)
Initializes the factory with known GridStart implementations. |
GridStart |
loadGridStart(Job job,
String gridStartPath)
Loads the appropriate gridstart implementation for a job on the basis of the value of the GRIDSTART_KEY in the Pegasus namepsace. |
private GridStart |
loadGridStart(PegasusBag bag,
ADag dag,
String className)
Loads the implementing class corresponding to the class. |
POSTScript |
loadPOSTScript(Job job,
GridStart gridStart)
Loads the appropriate POST Script implementation for a job on the basis of the value of the Pegasus profile GRIDSTART_KEY, and the DAGMan profile POST_SCRIPT_KEY in the Pegasus namepsace. |
private POSTScript |
loadPOSTScript(PegasusProperties properties,
String submitDir,
String path,
String className)
Loads the implementing class corresponding to the class. |
private POSTScript |
postScript(String type)
Returns the cached implementation of POSTScript
from the implementing class table. |
private void |
registerGridStart(String name,
GridStart implementation)
Inserts an entry into the implementing class table. |
private void |
registerPOSTScript(String name,
POSTScript implementation)
Inserts an entry into the implementing class table. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_PACKAGE_NAME
public static String[] GRIDSTART_SHORT_NAMES
public static final int KICKSTART_INDEX
public static final int NO_GRIDSTART_INDEX
public static final int SEQEXEC_INDEX
public static final String ESSENTIAL_POST_SCRIPT_SCOPE
public static final String ALL_POST_SCRIPT_SCOPE
public static String[] GRIDSTART_IMPLEMENTING_CLASSES
private static Map POSTSCRIPT_IMPLEMENTING_CLASS_TABLE
private Map mPOSTScriptImplementationTable
POSTScript implementations
with the implementations themselves.
private Map mGridStartImplementationTable
GridStart implementations
with the implementations themselves.
private PegasusBag mBag
private PegasusProperties mProps
private String mSubmitDir
private ADag mDAG
private boolean mInitialized
| Constructor Detail |
|---|
public GridStartFactory()
| Method Detail |
|---|
private static void associate(POSTScript ps)
ps - the POSTScript implementation.
private static void associate(String shortName,
String className)
shortName - the shortName for the POSTScript implementationclassName - the fully qualified className of the implementing class.private static String implementingPOSTScriptClass(String shortName)
shortName - the shortName for the POSTScript implementation
public void initialize(PegasusBag bag,
ADag dag)
bag - the bag of objects that is used for initialization.dag - the concrete dag so far.
public GridStart loadGridStart(Job job,
String gridStartPath)
throws GridStartFactoryException
job - the job for which we want the gridstart handle.gridStartPath - the path to the gridstart from the site catalog.
GridStartFactoryException - that nests any error that
might occur during the instantiation of the implementation.org.griphyn.cPlanner.namespace.Pegasus#GRIDSTART_KEY,
org.griphyn.cPlanner.common.PegasusProperties#getGridStart()
public POSTScript loadPOSTScript(Job job,
GridStart gridStart)
throws GridStartFactoryException
job - the job for which we want the gridstart handle.gridStart - the GridStart for which we want to load
the POSTSCRIPT implementation.
GridStartFactoryException - that nests any error that
might occur during the instantiation of the implementation.org.griphyn.cPlanner.namespace.Pegasus#GRIDSTART_KEY,
org.griphyn.cPlanner.namespace.Dagman#POST_SCRIPT_KEY,
org.griphyn.cPlanner.common.PegasusProperties#getGridStart()
private GridStart loadGridStart(PegasusBag bag,
ADag dag,
String className)
throws GridStartFactoryException
bag - the bag of initialization objectsdag - the concrete dag so far.className - the name of the class that implements the mode. It is the
name of the class, not the complete name with package. That
is added by itself.
GridStartFactoryException - that nests any error that
might occur during the instantiation of the implementation.DEFAULT_PACKAGE_NAME
private POSTScript loadPOSTScript(PegasusProperties properties,
String submitDir,
String path,
String className)
throws GridStartFactoryException
properties - the PegasusProperties object containing all
the properties required by Pegasus.submitDir - the submit directory where the submit file for the job
has to be generated.path - the path to the postscript on the submit host.className - the name of the class that implements the mode. It is the
name of the class, not the complete name with package. That
is added by itself.
GridStartFactoryException - that nests any error that
might occur during the instantiation of the implementation.DEFAULT_PACKAGE_NAMEprivate POSTScript postScript(String type)
POSTScript
from the implementing class table.
type - the short name for a POSTScript implementation
private void registerPOSTScript(String name,
POSTScript implementation)
name - the short name for a POSTScript implementationimplementation - the object of the class implementing that style.private GridStart gridStart(String name)
name - the short name for a GridStart implementation
private void registerGridStart(String name,
GridStart implementation)
name - the short name for a GridStart implementationimplementation - the object of the class implementing that style.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||