Interface ConfigurationFactory

  • All Known Implementing Classes:
    DefaultConfigurationFactory

    public interface ConfigurationFactory
    Create a Configuration knowing the container to which it is attached to and the configuration type. A container is identified by both its id and its type. Indeed, it's possible to register different configuration classes for the same container id but for a different container type.
    • Method Detail

      • registerConfiguration

        void registerConfiguration​(String containerId,
                                   ContainerType containerType,
                                   ConfigurationType configurationType,
                                   Class<? extends Configuration> configurationClass)
        Registers a configuration implementation.
        Parameters:
        containerId - the container id attached to this configuration class
        containerType - the container type attached to this configuration class
        configurationType - the type to differentiate this configuration from others for the specified container
        configurationClass - the configuration implementation class to register
      • getConfigurationClass

        Class<? extends Configuration> getConfigurationClass​(String containerId,
                                                             ContainerType containerType,
                                                             ConfigurationType configurationType)
        Parameters:
        containerId - the container id attached to this configuration class
        containerType - the container type attached to this configuration class
        configurationType - the configuration's type
        Returns:
        the configuration implementation class
      • isConfigurationRegistered

        boolean isConfigurationRegistered​(String containerId,
                                          ContainerType containerType,
                                          ConfigurationType configurationType)
        Parameters:
        containerId - the container id attached to this configuration class
        containerType - the container type attached to this configuration class
        configurationType - the type to differentiate this configuration from others for the specified container
        Returns:
        true if the specified configuration is already registered or false otherwise
      • createConfiguration

        Configuration createConfiguration​(String containerId,
                                          ContainerType containerType,
                                          ConfigurationType configurationType)
        Create a configuration instance matching the specified container and type.
        Parameters:
        containerId - the id of the container for which to create a configuration
        containerType - the type of the container for which to create a configuration
        configurationType - the type that differentiates the configuration we wish to create from other configurations for this container
        Returns:
        the configuration instance
      • createConfiguration

        Configuration createConfiguration​(String containerId,
                                          ContainerType containerType,
                                          ConfigurationType configurationType,
                                          String home)
        Create a configuration instance matching the specified container and type.
        Parameters:
        containerId - the id of the container for which to create a configuration
        containerType - the type of the container for which to create a configuration
        configurationType - the type that differentiates the configuration we wish to create from other configurations for this container
        home - the configuration home
        Returns:
        the configuration instance