Class ReplicaSelectorFactory


  • public class ReplicaSelectorFactory
    extends java.lang.Object
    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 
      Modifier and Type Field Description
      static java.lang.String DEFAULT_PACKAGE_NAME
      The default package where the all the implementing classes provided with the VDS reside.
      static java.lang.String DEFAULT_REPLICA_SELECTOR
      The name of the class in the DEFAULT package, that corresponds to the default replica selector.
    • Field Detail

      • DEFAULT_PACKAGE_NAME

        public static final java.lang.String DEFAULT_PACKAGE_NAME
        The default package where the all the implementing classes provided with the VDS reside.
        See Also:
        Constant Field Values
      • DEFAULT_REPLICA_SELECTOR

        public static final java.lang.String DEFAULT_REPLICA_SELECTOR
        The name of the class in the DEFAULT package, that corresponds to the default replica selector.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ReplicaSelectorFactory

        public ReplicaSelectorFactory()
    • Method Detail

      • loadInstance

        public static ReplicaSelector loadInstance​(PegasusProperties properties,
                                                   java.lang.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 - the PegasusProperties 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:
        DEFAULT_PACKAGE_NAME