org.codehaus.cargo.generic
Interface ContainerFactory
- All Known Implementing Classes:
- DefaultContainerFactory
public interface ContainerFactory
Allow instantiating a container by id (e.g. "resin3x").
- Version:
- $Id: ContainerFactory.java 1705 2008-09-02 13:14:55Z adriana $
registerContainer
void registerContainer(String containerId,
ContainerType containerType,
Class containerClass)
- Parameters:
containerId
- 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 register
getContainerClass
Class getContainerClass(String containerId,
ContainerType containerType)
- Parameters:
containerId
- the id of the container for which to retrieve the implementation classcontainerType
- the container's type (ContainerType.INSTALLED
,
ContainerType.EMBEDDED
or ContainerType.REMOTE
)
- Returns:
- the container implementation class
isContainerRegistered
boolean isContainerRegistered(String containerId,
ContainerType containerType)
- Parameters:
containerId
- the id of the container to checkcontainerType
- the container type
- Returns:
- true if the specified container and type is already registered or false otherwise
getContainerIds
Map getContainerIds()
- Returns:
- the list of container ids that have been registered as Map. The Map keys are the
container ids and the Map values are the lists of
ContainerType
s registered
for that container, as a Set.
createContainer
Container createContainer(String containerId,
ContainerType containerType,
Configuration configuration)
- Create a container instance instantiated using the specified configuration.
- Parameters:
containerId
- 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 constructor
- Returns:
- the container whose class name matches the parameter passed
Copyright © 2004-2012 Codehaus. All Rights Reserved.