|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.cargo.util.log.LoggedObject
org.codehaus.cargo.generic.spi.AbstractGenericHintFactory
public abstract class AbstractGenericHintFactory
Factory implementation that registers implementation classes under a given key of type
RegistrationKey
. This abstract factory class
is extended by all the different Cargo factories.
Nested Class Summary | |
---|---|
static interface |
AbstractGenericHintFactory.GenericParameters
Generic class to be extended by implementors of AbstractGenericHintFactory in
order to provide possible additional parameters. |
Constructor Summary | |
---|---|
protected |
AbstractGenericHintFactory()
Place to register default configurations. |
Method Summary | |
---|---|
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. |
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 |
---|
protected AbstractGenericHintFactory()
Method Detail |
---|
protected boolean hasMapping(RegistrationKey key)
key
- the key associated with the implementation class
protected Class getMapping(RegistrationKey key)
key
- the key associated with the implementation class to return
protected 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 object
NoSuchMethodException
- 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 instance
Exception
- in case of error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |