Package org.codehaus.cargo.generic
Interface ContainerFactory
-
- All Known Implementing Classes:
DefaultContainerFactory
public interface ContainerFactory
Allow instantiating a container by id (e.g. "resin3x").
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Container
createContainer(String containerId, ContainerType containerType, Configuration configuration)
Create a container instance instantiated using the specified configuration.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)
-
-
-
Method Detail
-
registerContainer
void registerContainer(String containerId, ContainerType containerType, Class<? extends Container> containerClass)
- Parameters:
containerId
- the id of the container to registercontainerType
- the container type to register (ContainerType.INSTALLED
,ContainerType.EMBEDDED
orContainerType.REMOTE
)containerClass
- the container implementation class to register
-
getContainerClass
Class<? extends Container> 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
orContainerType.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<String,Set<ContainerType>> getContainerIds()
- Returns:
- the list of container ids that have been registered as Map.
-
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
-
-