Class CondorStyleFactory
- java.lang.Object
-
- edu.isi.pegasus.planner.code.generator.condor.CondorStyleFactory
-
public class CondorStyleFactory extends java.lang.Object
A factory class to load the appropriate type of Condor Style impelementations. 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.- Version:
- $Revision$
- Author:
- Karan Vahi
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
CONDOR_STYLE_IMPLEMENTING_CLASS
The name of the class implementing the Condor Style.private static java.lang.String
CONDORC_STYLE_IMPLEMENTING_CLASS
The name of the class implementing the CondorC Style.private static java.lang.String
CREAMCE_STYLE_IMPLEMENTING_CLASS
The name of the class implementing the CREAMCE Style.static java.lang.String
DEFAULT_PACKAGE_NAME
The default package where the all the implementing classes are supposed to reside.private static java.lang.String
GLIDEIN_STYLE_IMPLEMENTING_CLASS
The name of the class implementing the Condor GlideIN Style.private static java.lang.String
GLIDEINWMS_STYLE_IMPLEMENTING_CLASS
The name of the class implementing the Condor GlideinWMS Style.private static java.lang.String
GLITE_STYLE_IMPLEMENTING_CLASS
The name of the class implementing the CondorG Style.private static java.lang.String
GLOBUS_STYLE_IMPLEMENTING_CLASS
The name of the class implementing the CondorG Style.private CredentialHandlerFactory
mCredentialFactory
Handler to the Credential Handler factory.private static java.util.Map
mImplementingClassNameTable
A table that maps, Pegasus style keys to the names of the corresponding classes implementing the CondorStyle interface.private java.util.Map
mImplementingClassTable
A table that maps, Pegasus style keys to appropriate classes implementing the CondorStyle interfaceprivate boolean
mInitialized
A boolean indicating that the factory has been initialized.private static java.lang.String
SSH_STYLE_IMPLEMENTING_CLASS
The name of the class implementing the CondorG Style.
-
Constructor Summary
Constructors Constructor Description CondorStyleFactory()
The default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.Object
get(java.lang.String style)
Returns the implementation from the implementing class table.private static java.util.Map
implementingClassNameTable()
Returns a table that maps, the Pegasus style keys to the names of implementing classes.void
initialize(PegasusBag bag)
Initializes the Factory.CondorStyle
loadInstance(Job job)
This method loads the appropriate implementing CondorStyle as specified by the user at runtime.private CondorStyle
loadInstance(PegasusBag bag, java.lang.String className)
This method loads the appropriate Condor Style using reflection.private void
put(java.lang.String style, java.lang.Object implementation)
Inserts an entry into the implementing class table.
-
-
-
Field Detail
-
DEFAULT_PACKAGE_NAME
public static final java.lang.String DEFAULT_PACKAGE_NAME
The default package where the all the implementing classes are supposed to reside.- See Also:
- Constant Field Values
-
CONDOR_STYLE_IMPLEMENTING_CLASS
private static final java.lang.String CONDOR_STYLE_IMPLEMENTING_CLASS
The name of the class implementing the Condor Style.- See Also:
- Constant Field Values
-
GLIDEIN_STYLE_IMPLEMENTING_CLASS
private static final java.lang.String GLIDEIN_STYLE_IMPLEMENTING_CLASS
The name of the class implementing the Condor GlideIN Style.- See Also:
- Constant Field Values
-
GLIDEINWMS_STYLE_IMPLEMENTING_CLASS
private static final java.lang.String GLIDEINWMS_STYLE_IMPLEMENTING_CLASS
The name of the class implementing the Condor GlideinWMS Style.- See Also:
- Constant Field Values
-
GLOBUS_STYLE_IMPLEMENTING_CLASS
private static final java.lang.String GLOBUS_STYLE_IMPLEMENTING_CLASS
The name of the class implementing the CondorG Style.- See Also:
- Constant Field Values
-
CONDORC_STYLE_IMPLEMENTING_CLASS
private static final java.lang.String CONDORC_STYLE_IMPLEMENTING_CLASS
The name of the class implementing the CondorC Style.- See Also:
- Constant Field Values
-
CREAMCE_STYLE_IMPLEMENTING_CLASS
private static final java.lang.String CREAMCE_STYLE_IMPLEMENTING_CLASS
The name of the class implementing the CREAMCE Style.- See Also:
- Constant Field Values
-
GLITE_STYLE_IMPLEMENTING_CLASS
private static final java.lang.String GLITE_STYLE_IMPLEMENTING_CLASS
The name of the class implementing the CondorG Style.- See Also:
- Constant Field Values
-
SSH_STYLE_IMPLEMENTING_CLASS
private static final java.lang.String SSH_STYLE_IMPLEMENTING_CLASS
The name of the class implementing the CondorG Style.- See Also:
- Constant Field Values
-
mImplementingClassNameTable
private static java.util.Map mImplementingClassNameTable
A table that maps, Pegasus style keys to the names of the corresponding classes implementing the CondorStyle interface.
-
mImplementingClassTable
private java.util.Map mImplementingClassTable
A table that maps, Pegasus style keys to appropriate classes implementing the CondorStyle interface
-
mInitialized
private boolean mInitialized
A boolean indicating that the factory has been initialized.
-
mCredentialFactory
private CredentialHandlerFactory mCredentialFactory
Handler to the Credential Handler factory.
-
-
Method Detail
-
implementingClassNameTable
private static java.util.Map implementingClassNameTable()
Returns a table that maps, the Pegasus style keys to the names of implementing classes.- Returns:
- a Map indexed by Pegasus styles, and values as names of implementing classes.
-
initialize
public void initialize(PegasusBag bag) throws CondorStyleFactoryException
Initializes the Factory. Loads all the implementations just once.- Parameters:
bag
- the bag of initialization objects- Throws:
CondorStyleFactoryException
- that nests any error that might occur during the instantiation of the implementation.
-
loadInstance
public CondorStyle loadInstance(Job job) throws CondorStyleFactoryException
This method loads the appropriate implementing CondorStyle as specified by the user at runtime. The CondorStyle is initialized and returned.- Parameters:
job
- the job for which the corresponding style is required.- Throws:
CondorStyleFactoryException
- that nests any error that might occur during the instantiation of the implementation.
-
loadInstance
private CondorStyle loadInstance(PegasusBag bag, java.lang.String className) throws CondorStyleFactoryException
This method loads the appropriate Condor Style using reflection.- Parameters:
bag
- the bag of initialization objectsclassName
- the name of the implementing class.- Returns:
- the instance of the class implementing this interface.
- Throws:
CondorStyleFactoryException
- that nests any error that might occur during the instantiation of the implementation.- See Also:
DEFAULT_PACKAGE_NAME
-
get
private java.lang.Object get(java.lang.String style)
Returns the implementation from the implementing class table.- Parameters:
style
- the Pegasus style- Returns:
- implementation the class implementing that style, else null
-
put
private void put(java.lang.String style, java.lang.Object implementation)
Inserts an entry into the implementing class table.- Parameters:
style
- the Pegasus styleimplementation
- the class implementing that style.
-
-