public abstract class AbstractGenericHintFactory
extends org.codehaus.cargo.util.log.LoggedObject
RegistrationKey
. This abstract factory class
is extended by all the different Cargo factories.Modifier and Type | Class and Description |
---|---|
static interface |
AbstractGenericHintFactory.GenericParameters
Generic class to be extended by implementors of
AbstractGenericHintFactory in
order to provide possible additional parameters. |
Modifier | Constructor and Description |
---|---|
protected |
AbstractGenericHintFactory()
Place to register default configurations.
|
Modifier and Type | Method and Description |
---|---|
protected Object |
createImplementation(RegistrationKey key,
AbstractGenericHintFactory.GenericParameters parameters,
String implementationConceptName)
Generic method to create an implementation based on the registered implementation classes.
|
protected abstract Object |
createInstance(Constructor constructor,
String hint,
AbstractGenericHintFactory.GenericParameters parameters)
Create an implementation class instance.
|
protected abstract Constructor |
getConstructor(Class implementationClass,
String hint,
AbstractGenericHintFactory.GenericParameters parameters)
Create a constructor.
|
protected Class |
getMapping(RegistrationKey key) |
protected Map |
getMappings() |
protected boolean |
hasMapping(RegistrationKey key) |
protected void |
registerImplementation(RegistrationKey key,
Class implementationClass)
Register an implementation class for a given key.
|
protected AbstractGenericHintFactory()
protected boolean hasMapping(RegistrationKey key)
key
- the key associated with the implementation classprotected Class getMapping(RegistrationKey key)
key
- the key associated with the implementation class to returnprotected Map getMappings()
RegistrationKey
.protected void registerImplementation(RegistrationKey key, Class implementationClass)
key
- the key under which to register the implementation classimplementationClass
- the implementation class to registerprotected Object createImplementation(RegistrationKey key, AbstractGenericHintFactory.GenericParameters parameters, String implementationConceptName)
key
- the key under which the implementation class is registeredparameters
- the additional parameters necessary to create the constructor objectimplementationConceptName
- 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.protected abstract Constructor getConstructor(Class implementationClass, String hint, AbstractGenericHintFactory.GenericParameters parameters) throws NoSuchMethodException
implementationClass
- implementation class for which to create the constructorhint
- the hint to differentiate this implementation class from othersparameters
- additional parameters necessary to create the constructor objectNoSuchMethodException
- in case of errorprotected abstract Object createInstance(Constructor constructor, String hint, AbstractGenericHintFactory.GenericParameters parameters) throws Exception
constructor
- the constructor to use for creating the instancehint
- the hint to differentiate this implementation class from othersparameters
- additional parameters necessary to create the instanceException
- in case of errorCopyright © 2004-2013 Codehaus. All Rights Reserved.