public class DefaultContainerFactory extends AbstractIntrospectionGenericHintFactory<Container> implements ContainerFactory
ContainerFactory. Registers all known containers.AbstractGenericHintFactory.GenericParameters| Constructor and Description |
|---|
DefaultContainerFactory()
Initialize container name mappings with container ids.
|
DefaultContainerFactory(ClassLoader classLoader)
Register packager name mappings.
|
| Modifier and Type | Method and Description |
|---|---|
Container |
createContainer(String containerId,
ContainerType containerType,
Configuration configuration)
Create a container instance instantiated using the specified configuration.
|
protected Container |
createInstance(Constructor<? extends Container> constructor,
String containerType,
AbstractGenericHintFactory.GenericParameters parameters)
Create an implementation class instance.
|
protected Constructor<? extends Container> |
getConstructor(Class<? extends Container> containerClass,
String containerType,
AbstractGenericHintFactory.GenericParameters parameters)
Create a constructor.
|
Class<? extends Container> |
getContainerClass(String containerId,
ContainerType containerType) |
Map<String,Set<ContainerType>> |
getContainerIds() |
boolean |
isContainerRegistered(String containerId,
ContainerType containerType) |
void |
registerContainer(String containerId,
ContainerType containerType,
Class<? extends Container> containerClass) |
void |
registerContainer(String containerId,
ContainerType containerType,
String containerClassName)
Registers a container using a class specified as a String.
|
createImplementation, registerImplementationgetMapping, getMappings, hasMapping, registerImplementationpublic DefaultContainerFactory()
public DefaultContainerFactory(ClassLoader classLoader)
classLoader - ClassLoader to discover implementations from. See
AbstractFactoryRegistry.register(ClassLoader, ContainerFactory) for the
details of what this value means.public boolean isContainerRegistered(String containerId, ContainerType containerType)
isContainerRegistered in interface ContainerFactorycontainerId - the id of the container to checkcontainerType - the container typeContainerFactory.isContainerRegistered(String, ContainerType)public void registerContainer(String containerId, ContainerType containerType, Class<? extends Container> containerClass)
registerContainer in interface ContainerFactorycontainerId - the id of the container to registercontainerType - the container type to register (ContainerType.INSTALLED,
ContainerType.EMBEDDED or ContainerType.REMOTE)containerClass - the container implementation class to registerContainerFactory.registerContainer(String, org.codehaus.cargo.container.ContainerType,
Class)public void registerContainer(String containerId, ContainerType containerType, String containerClassName)
containerId - containerType - containerClassName - the container implementation class to register as a StringregisterContainer(String, ContainerType, Class)public Class<? extends Container> getContainerClass(String containerId, ContainerType containerType)
getContainerClass in interface ContainerFactorycontainerId - the id of the container for which to retrieve the implementation classcontainerType - the container's type (ContainerType.INSTALLED,
ContainerType.EMBEDDED or ContainerType.REMOTE)ContainerFactory.getContainerClass(java.lang.String, org.codehaus.cargo.container.ContainerType)public Container createContainer(String containerId, ContainerType containerType, Configuration configuration)
createContainer in interface ContainerFactorycontainerId - the name under which the container will be looked upcontainerType - the container's type (local installed, local embedded, remote, etc)configuration - the configuration to pass to the container's constructorContainerFactory.createContainer(String, ContainerType, Configuration)protected Constructor<? extends Container> getConstructor(Class<? extends Container> containerClass, String containerType, AbstractGenericHintFactory.GenericParameters parameters) throws NoSuchMethodException
getConstructor in class AbstractGenericHintFactory<Container>containerClass - implementation class for which to create the constructorcontainerType - the hint to differentiate this implementation class from othersparameters - additional parameters necessary to create the constructor objectNoSuchMethodException - in case of errorAbstractGenericHintFactory.getConstructor(java.lang.Class<? extends T>, java.lang.String, org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.GenericParameters)protected Container createInstance(Constructor<? extends Container> constructor, String containerType, AbstractGenericHintFactory.GenericParameters parameters) throws Exception
createInstance in class AbstractGenericHintFactory<Container>constructor - the constructor to use for creating the instancecontainerType - the hint to differentiate this implementation class from othersparameters - additional parameters necessary to create the instanceException - in case of errorAbstractGenericHintFactory.createInstance(java.lang.reflect.Constructor<? extends T>, java.lang.String, org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.GenericParameters)public Map<String,Set<ContainerType>> getContainerIds()
getContainerIds in interface ContainerFactoryContainerFactory.getContainerIds()Copyright © 2004–2015 Github. All rights reserved.