Class ReplicaSelectorFactory
java.lang.Object
edu.isi.pegasus.planner.selector.replica.ReplicaSelectorFactory
A factory class to load the appropriate type of Replica Selector, as specified by the user at
runtime in properties. Each invocation of the factory results in a ReplicaSelector being
instantiated.
- Version:
- $Revision$
- Author:
- Karan Vahi
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ReplicaSelector
A no hassle factory method that loads the replica selector specified in the properties.static ReplicaSelector
loadInstance
(edu.isi.pegasus.planner.common.PegasusProperties properties) Loads the implementing class corresponding to the mode specified by the user at runtime in the properties file.static ReplicaSelector
loadInstance
(edu.isi.pegasus.planner.common.PegasusProperties properties, String className) Loads the implementing class corresponding to the class.
-
Field Details
-
DEFAULT_PACKAGE_NAME
The default package where the all the implementing classes provided with the VDS reside.- See Also:
-
DEFAULT_REPLICA_SELECTOR
The name of the class in the DEFAULT package, that corresponds to the default replica selector.- See Also:
-
-
Constructor Details
-
ReplicaSelectorFactory
public ReplicaSelectorFactory()
-
-
Method Details
-
loadInstance
A no hassle factory method that loads the replica selector specified in the properties. The properties are obtained from the property singleton. A default replica selector is loaded if property is not specified in the properties.- Returns:
- the instance of the class implementing this interface.
- Throws:
ReplicaSelectorFactoryException
- that chains any error that might occur during the instantiation- See Also:
-
loadInstance
public static ReplicaSelector loadInstance(edu.isi.pegasus.planner.common.PegasusProperties properties) throws ReplicaSelectorFactoryException Loads the implementing class corresponding to the mode specified by the user at runtime in the properties file. A default replica selector is loaded if property is not specified in the properties.- Parameters:
properties
- thePegasusProperties
object containing all the properties required by Pegasus.- Returns:
- the instance of the class implementing this interface.
- Throws:
ReplicaSelectorFactoryException
- that chains any error that might occur during the instantiation- See Also:
-
loadInstance
public static ReplicaSelector loadInstance(edu.isi.pegasus.planner.common.PegasusProperties properties, String className) throws ReplicaSelectorFactoryException Loads the implementing class corresponding to the class. If the package name is not specified with the class, then class is assumed to be in the DEFAULT_PACKAGE. The properties object passed should not be null.- Parameters:
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.properties
- thePegasusProperties
object containing all the properties required by Pegasus.- Returns:
- the instance of the class implementing this interface.
- Throws:
ReplicaSelectorFactoryException
- that chains any error that might occur during the instantiation- See Also:
-