org.codehaus.cargo.generic.configuration
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.

Version:
$Id: ConfigurationFactory.java 1705 2008-09-02 13:14:55Z adriana $

Method Summary
 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 getConfigurationClass(String containerId, ContainerType containerType, ConfigurationType configurationType)
           
 boolean isConfigurationRegistered(String containerId, ContainerType containerType, ConfigurationType configurationType)
           
 void registerConfiguration(String containerId, ContainerType containerType, ConfigurationType configurationType, Class configurationClass)
          Registers a configuration implementation.
 

Method Detail

registerConfiguration

void registerConfiguration(String containerId,
                           ContainerType containerType,
                           ConfigurationType configurationType,
                           Class 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 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 configuation 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 configuation instance


Copyright © 2004-2012 Codehaus. All Rights Reserved.