org.griphyn.cPlanner.code.generator
Class Abstract

java.lang.Object
  extended by org.griphyn.cPlanner.code.generator.Abstract
All Implemented Interfaces:
CodeGenerator
Direct Known Subclasses:
CondorGenerator, GRMS, Stork

public abstract class Abstract
extends Object
implements CodeGenerator

An Abstract Base class implementing the CodeGenerator interface. Introduces helper methods for determining basenames of files, that contain concrete job descriptions.

Version:
$Revision: 410 $
Author:
Karan Vahi, Gaurang Mehta

Field Summary
protected  PegasusBag mBag
          The bag of initialization objects.
protected  PlannerOptions mPOptions
          The object containing the command line options specified to the planner at runtime.
protected  PegasusProperties mProps
          The object holding all the properties pertaining to Pegasus.
protected  String mSubmitFileDir
          The directory where all the submit files are to be generated.
 
Fields inherited from interface org.griphyn.cPlanner.code.CodeGenerator
VERSION
 
Constructor Summary
Abstract()
           
 
Method Summary
 String getFileBaseName(SubInfo job)
          Returns the basename of the file to which the job is written to.
 PrintWriter getWriter(SubInfo job)
          Returns an open stream to the file that is used for writing out the job information for the job.
 void initialize(PegasusBag bag)
          Initializes the Code Generator implementation.
 void reset()
          Resets the Code Generator implementation.
 boolean startMonitoring()
          Starts monitoring of the workflow by invoking a workflow monitor daemon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.griphyn.cPlanner.code.CodeGenerator
generateCode, generateCode
 

Field Detail

mBag

protected PegasusBag mBag
The bag of initialization objects.


mSubmitFileDir

protected String mSubmitFileDir
The directory where all the submit files are to be generated.


mProps

protected PegasusProperties mProps
The object holding all the properties pertaining to Pegasus.


mPOptions

protected PlannerOptions mPOptions
The object containing the command line options specified to the planner at runtime.

Constructor Detail

Abstract

public Abstract()
Method Detail

initialize

public void initialize(PegasusBag bag)
                throws CodeGeneratorException
Initializes the Code Generator implementation.

Specified by:
initialize in interface CodeGenerator
Parameters:
bag - the bag of initialization objects.
Throws:
CodeGeneratorException - in case of any error occuring code generation.

startMonitoring

public boolean startMonitoring()
Starts monitoring of the workflow by invoking a workflow monitor daemon. The monitoring should start only after the output files have been generated. FIXME: It should actually happen after the workflow has been submitted. Eventually should be a separate monitor interface, and submit writers should be loaded by an AbstractFactory.

Specified by:
startMonitoring in interface CodeGenerator
Returns:
boolean indicating whether could successfully start the monitor daemon or not.

reset

public void reset()
           throws CodeGeneratorException
Resets the Code Generator implementation.

Specified by:
reset in interface CodeGenerator
Throws:
CodeGeneratorException - in case of any error occuring code generation.

getWriter

public PrintWriter getWriter(SubInfo job)
                      throws IOException
Returns an open stream to the file that is used for writing out the job information for the job.

Parameters:
job - the job whose job information needs to be written.
Returns:
the writer to the open file.
Throws:
IOException - if unable to open a write handle to the file.

getFileBaseName

public String getFileBaseName(SubInfo job)
Returns the basename of the file to which the job is written to.

Parameters:
job - the job whose job information needs to be written.
Returns:
the basename of the file.


Copyright © 2007 The University of Southern California. All Rights Reserved.