Package org.codehaus.cargo.generic.spi
Class AbstractGenericHintFactory<T>
- java.lang.Object
- 
- org.codehaus.cargo.util.log.LoggedObject
- 
- org.codehaus.cargo.generic.spi.AbstractGenericHintFactory<T>
 
 
- 
- All Implemented Interfaces:
- Loggable
 - Direct Known Subclasses:
- AbstractIntrospectionGenericHintFactory
 
 public abstract class AbstractGenericHintFactory<T> extends LoggedObject Factory implementation that registers implementation classes under a given key of typeRegistrationKey. This abstract factory class is extended by all the different Cargo factories.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static interfaceAbstractGenericHintFactory.GenericParametersGeneric class to be extended by implementors ofAbstractGenericHintFactoryin order to provide possible additional parameters.
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedAbstractGenericHintFactory()Place to register default configurations.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected TcreateImplementation(RegistrationKey key, AbstractGenericHintFactory.GenericParameters parameters, String implementationConceptName)Generic method to create an implementation based on the registered implementation classes.protected abstract TcreateInstance(Constructor<? extends T> constructor, String hint, AbstractGenericHintFactory.GenericParameters parameters)Create an implementation class instance.protected abstract Constructor<? extends T>getConstructor(Class<? extends T> implementationClass, String hint, AbstractGenericHintFactory.GenericParameters parameters)Create a constructor.protected Class<? extends T>getMapping(RegistrationKey key)protected Map<RegistrationKey,Class<? extends T>>getMappings()protected booleanhasMapping(RegistrationKey key)protected voidregisterImplementation(RegistrationKey key, Class<? extends T> implementationClass)Register an implementation class for a given key.- 
Methods inherited from class org.codehaus.cargo.util.log.LoggedObjectgetLogger, setLogger
 
- 
 
- 
- 
- 
Method Detail- 
hasMappingprotected boolean hasMapping(RegistrationKey key) - Parameters:
- key- the key associated with the implementation class
- Returns:
- true if the mapping is already registered or false otherwise
 
 - 
getMappingprotected Class<? extends T> getMapping(RegistrationKey key) - Parameters:
- key- the key associated with the implementation class to return
- Returns:
- the implementation class
 
 - 
getMappingsprotected Map<RegistrationKey,Class<? extends T>> getMappings() - Returns:
- the mappings indexed using a RegistrationKey.
 
 - 
registerImplementationprotected void registerImplementation(RegistrationKey key, Class<? extends T> implementationClass) Register an implementation class for a given key.- Parameters:
- key- the key under which to register the implementation class
- implementationClass- the implementation class to register
 
 - 
createImplementationprotected T createImplementation(RegistrationKey key, AbstractGenericHintFactory.GenericParameters parameters, String implementationConceptName) Generic method to create an implementation based on the registered implementation classes.- Parameters:
- key- the key under which the implementation class is registered
- parameters- the additional parameters necessary to create the constructor object
- implementationConceptName- the name of what the implementation class is representing. This is used in exception text messages to provide message customization. For example "container", "configuration", "deployable', etc.
- Returns:
- the created instance
 
 - 
getConstructorprotected abstract Constructor<? extends T> getConstructor(Class<? extends T> implementationClass, String hint, AbstractGenericHintFactory.GenericParameters parameters) throws NoSuchMethodException Create a constructor.- Parameters:
- implementationClass- 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:
- NoSuchMethodException- in case of error
 
 - 
createInstanceprotected abstract T createInstance(Constructor<? extends T> constructor, String hint, AbstractGenericHintFactory.GenericParameters parameters) throws Exception Create an implementation class instance.- 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:
- Exception- in case of error
 
 
- 
 
-