org.griphyn.cPlanner.code.generator
Class CodeGeneratorFactory

java.lang.Object
  extended by org.griphyn.cPlanner.code.generator.CodeGeneratorFactory

public class CodeGeneratorFactory
extends Object

A factory class to load the appropriate type of Code Generator. The CodeGenerator implementation is used to write out the concrete plan.

Version:
$Revision: 410 $
Author:
Karan Vahi

Field Summary
static String CONDOR_CODE_GENERATOR_CLASS
          The name of the class implementing the condor code generator.
static String DEFAULT_PACKAGE_NAME
          The default package where the all the implementing classes are supposed to reside.
 
Constructor Summary
CodeGeneratorFactory()
           
 
Method Summary
static CodeGenerator loadInstance(PegasusBag bag)
          This method loads the appropriate implementing code generator as specified by the user at runtime.
static CodeGenerator loadInstance(PegasusBag bag, String className)
          This method loads the appropriate code generator as specified by the user at runtime.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PACKAGE_NAME

public static final String DEFAULT_PACKAGE_NAME
The default package where the all the implementing classes are supposed to reside.

See Also:
Constant Field Values

CONDOR_CODE_GENERATOR_CLASS

public static final String CONDOR_CODE_GENERATOR_CLASS
The name of the class implementing the condor code generator.

See Also:
Constant Field Values
Constructor Detail

CodeGeneratorFactory

public CodeGeneratorFactory()
Method Detail

loadInstance

public static CodeGenerator loadInstance(PegasusBag bag)
                                  throws CodeGeneratorFactoryException
This method loads the appropriate implementing code generator as specified by the user at runtime. If the megadag mode is specified in the options, then that is used to load the implementing class, overriding the submit mode specified in the properties file.

Parameters:
bag - the bag of initialization objects.
Returns:
the instance of the class implementing this interface.
Throws:
CodeGeneratorFactoryException - that nests any error that might occur during the instantiation of the implementation.
See Also:
DEFAULT_PACKAGE_NAME, PegasusProperties.getDAXCallback()

loadInstance

public static CodeGenerator loadInstance(PegasusBag bag,
                                         String className)
                                  throws CodeGeneratorFactoryException
This method loads the appropriate code generator as specified by the user at runtime.

Parameters:
bag - the bag of initialization objects.
className - the name of the implementing class.
Returns:
the instance of the class implementing this interface.
Throws:
CodeGeneratorFactoryException - that nests any error that might occur during the instantiation of the implementation.
See Also:
DEFAULT_PACKAGE_NAME


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