Interface ConfigurationFactory
-
- All Known Implementing Classes:
DefaultConfigurationFactory
public interface ConfigurationFactory
Create aConfiguration
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Configuration
createConfiguration(String containerId, ContainerType containerType, ConfigurationType configurationType)
Create a configuration instance matching the specified container and type.Configuration
createConfiguration(String containerId, ContainerType containerType, ConfigurationType configurationType, String home)
Create a configuration instance matching the specified container and type.Class<? extends Configuration>
getConfigurationClass(String containerId, ContainerType containerType, ConfigurationType configurationType)
boolean
isConfigurationRegistered(String containerId, ContainerType containerType, ConfigurationType configurationType)
void
registerConfiguration(String containerId, ContainerType containerType, ConfigurationType configurationType, Class<? extends Configuration> configurationClass)
Registers a configuration implementation.
-
-
-
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 classcontainerType
- the container type attached to this configuration classconfigurationType
- the type to differentiate this configuration from others for the specified containerconfigurationClass
- 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 classcontainerType
- the container type attached to this configuration classconfigurationType
- 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 classcontainerType
- the container type attached to this configuration classconfigurationType
- 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 configurationcontainerType
- the type of the container for which to create a configurationconfigurationType
- 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 configurationcontainerType
- the type of the container for which to create a configurationconfigurationType
- the type that differentiates the configuration we wish to create from other configurations for this containerhome
- the configuration home- Returns:
- the configuration instance
-
-