edu.isi.pegasus.planner.code

## Interface CodeGenerator

All Known Implementing Classes:
  Abstract, CondorGenerator, DAXReplicaStore, HashedFile, MonitordNotify, PBS, PMC, Shell, Stampede, Stork

    public interface CodeGenerator

The interface that allows us to plug in various code generators for writing out the concrete plan. Each of Code Generators are dependant upon the underlying workflow executors being used. A Code Generator implementation generates the concrete plan in the input format of the underlying Workflow Executor. The appropriate format can be condor submit files, or some XML description.

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

### Field Summary

Fields
`static java.lang.String` `VERSION` The version number associated with this API of Code Generator.

### Method Summary

All Methods Instance Methods Abstract Methods
`java.util.Collection<java.io.File>` `generateCode(ADag dag)` Generates the code for the concrete workflow in the input format of the workflow executor being used.
`void` `generateCode(ADag dag, Job job)` Generates the code for a single job in the input format of the workflow executor being used.
`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.

### Field Detail

#### VERSION

    static final java.lang.String VERSION

The version number associated with this API of Code Generator.

See Also:
  Constant Field Values

### Method Detail

#### initialize

    void initialize(PegasusBag bag)
             throws CodeGeneratorException

Initializes the Code Generator implementation.

Parameters:
  `bag` - the bag of initialization objects.
Throws:
  `CodeGeneratorException` - in case of any error occuring code generation.

#### generateCode

    java.util.Collection<java.io.File> generateCode(ADag dag)
                                             throws CodeGeneratorException

Generates the code for the concrete workflow in the input format of the workflow executor being used.

Parameters:
  `dag` - the concrete workflow.
Returns:
  the Collection of `File` objects for the files written out.
Throws:
  `CodeGeneratorException` - in case of any error occuring code generation.

#### generateCode

    void generateCode(ADag dag,
                      Job job)
               throws CodeGeneratorException

Generates the code for a single job in the input format of the workflow executor being used.

Parameters:
  `dag` - the dag of which the job is a part of.
  `job` - the `Job` object holding the information about that particular job.
Throws:
  `CodeGeneratorException` - in case of any error occuring code generation.

#### startMonitoring

    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.

Returns:
  boolean indicating whether could successfully start the monitor daemon or not.

#### reset

    void reset()
        throws CodeGeneratorException

Resets the Code Generator implementation.

Throws:
  `CodeGeneratorException` - in case of any error occuring code generation.