org.codehaus.cargo.generic.configuration
Class DefaultConfigurationCapabilityFactory

java.lang.Object
  extended by org.codehaus.cargo.util.log.LoggedObject
      extended by org.codehaus.cargo.generic.spi.AbstractGenericHintFactory
          extended by org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactory
              extended by org.codehaus.cargo.generic.configuration.DefaultConfigurationCapabilityFactory
All Implemented Interfaces:
ConfigurationCapabilityFactory, org.codehaus.cargo.util.log.Loggable

public class DefaultConfigurationCapabilityFactory
extends AbstractIntrospectionGenericHintFactory
implements ConfigurationCapabilityFactory

Default implementation of ConfigurationCapabilityFactory. Registers all known configuration capabilities.

Version:
$Id: DefaultConfigurationCapabilityFactory.java 1233 2006-11-22 09:15:56Z vmassol $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.codehaus.cargo.generic.spi.AbstractGenericHintFactory
AbstractGenericHintFactory.GenericParameters
 
Constructor Summary
DefaultConfigurationCapabilityFactory()
          Initialize configuration capability name mappings with container ids and configuration types.
 
Method Summary
 org.codehaus.cargo.container.configuration.ConfigurationCapability createConfigurationCapability(java.lang.String containerId, org.codehaus.cargo.container.ContainerType containerType, org.codehaus.cargo.container.configuration.ConfigurationType configurationType)
          Create a ConfigurationCapability instance for a given container.
protected  java.lang.Object createInstance(java.lang.reflect.Constructor constructor, java.lang.String hint, AbstractGenericHintFactory.GenericParameters parameters)
          Create an implementation class instance.
protected  java.lang.reflect.Constructor getConstructor(java.lang.Class configurationCapabilityClass, java.lang.String hint, AbstractGenericHintFactory.GenericParameters parameters)
          Create a constructor.
 void registerConfigurationCapability(java.lang.String containerId, org.codehaus.cargo.container.ContainerType containerType, org.codehaus.cargo.container.configuration.ConfigurationType configurationType, java.lang.Class configurationCapabilityClass)
          
 void registerConfigurationCapability(java.lang.String containerId, org.codehaus.cargo.container.ContainerType containerType, org.codehaus.cargo.container.configuration.ConfigurationType configurationType, java.lang.String configurationCapabilityClass)
          Registers a configuration capability using a class specified as a String.
 
Methods inherited from class org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactory
createImplementation, registerImplementation
 
Methods inherited from class org.codehaus.cargo.generic.spi.AbstractGenericHintFactory
getMapping, getMappings, hasMapping, registerImplementation
 
Methods inherited from class org.codehaus.cargo.util.log.LoggedObject
getLogger, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultConfigurationCapabilityFactory

public DefaultConfigurationCapabilityFactory()
Initialize configuration capability name mappings with container ids and configuration types.

Method Detail

registerConfigurationCapability

public void registerConfigurationCapability(java.lang.String containerId,
                                            org.codehaus.cargo.container.ContainerType containerType,
                                            org.codehaus.cargo.container.configuration.ConfigurationType configurationType,
                                            java.lang.Class configurationCapabilityClass)

Specified by:
registerConfigurationCapability in interface ConfigurationCapabilityFactory
Parameters:
containerId - the id of the container to register against
containerType - the type of the container to register against
configurationType - the configuration type under which the capability should be registered
configurationCapabilityClass - the configuration capability implementation class to register
See Also:
ConfigurationCapabilityFactory.registerConfigurationCapability(java.lang.String, org.codehaus.cargo.container.ContainerType, org.codehaus.cargo.container.configuration.ConfigurationType, java.lang.Class)

registerConfigurationCapability

public void registerConfigurationCapability(java.lang.String containerId,
                                            org.codehaus.cargo.container.ContainerType containerType,
                                            org.codehaus.cargo.container.configuration.ConfigurationType configurationType,
                                            java.lang.String configurationCapabilityClass)
Registers a configuration capability using a class specified as a String.

Parameters:
containerId -
containerType -
configurationType -
configurationCapabilityClass - the configuration capability implementation class to register as a String
See Also:
registerConfigurationCapability(String, org.codehaus.cargo.container.ContainerType, org.codehaus.cargo.container.configuration.ConfigurationType, String)

createConfigurationCapability

public org.codehaus.cargo.container.configuration.ConfigurationCapability createConfigurationCapability(java.lang.String containerId,
                                                                                                        org.codehaus.cargo.container.ContainerType containerType,
                                                                                                        org.codehaus.cargo.container.configuration.ConfigurationType configurationType)
Create a ConfigurationCapability instance for a given container.

Specified by:
createConfigurationCapability in interface ConfigurationCapabilityFactory
Parameters:
containerId - the container id associated with the configuration capability
containerType - the container type associated with the configuration capability
configurationType - the configuration type associated with the capability
Returns:
the configuration capability instance matching the parameter passed
See Also:
ConfigurationCapabilityFactory.createConfigurationCapability(java.lang.String, org.codehaus.cargo.container.ContainerType, org.codehaus.cargo.container.configuration.ConfigurationType)

getConstructor

protected java.lang.reflect.Constructor getConstructor(java.lang.Class configurationCapabilityClass,
                                                       java.lang.String hint,
                                                       AbstractGenericHintFactory.GenericParameters parameters)
                                                throws java.lang.NoSuchMethodException
Create a constructor.

Specified by:
getConstructor in class AbstractGenericHintFactory
Parameters:
configurationCapabilityClass - implementation class for which to create the constructor
hint - the hint to differentiate this implementation class from others
parameters - additional parameters necessary to create the constructor object
Returns:
the constructor to use for creating an instance
Throws:
java.lang.NoSuchMethodException - in case of error
See Also:
AbstractGenericHintFactory.getConstructor(java.lang.Class, java.lang.String, org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.GenericParameters)

createInstance

protected java.lang.Object createInstance(java.lang.reflect.Constructor constructor,
                                          java.lang.String hint,
                                          AbstractGenericHintFactory.GenericParameters parameters)
                                   throws java.lang.Exception
Create an implementation class instance.

Specified by:
createInstance in class AbstractGenericHintFactory
Parameters:
constructor - the constructor to use for creating the instance
hint - the hint to differentiate this implementation class from others
parameters - additional parameters necessary to create the instance
Returns:
the created instance
Throws:
java.lang.Exception - in case of error
See Also:
AbstractGenericHintFactory.createInstance(java.lang.reflect.Constructor, java.lang.String, org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.GenericParameters)


Copyright © 2004-2009 Codehaus. All Rights Reserved.