public abstract class AbstractInstalledLocalContainer extends AbstractLocalContainer implements InstalledLocalContainer
Constructor and Description |
---|
AbstractInstalledLocalContainer(LocalConfiguration configuration)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addToolsJarToClasspath(org.apache.tools.ant.types.Path classpath)
Adds the tools.jar to the classpath, except for Mac OSX as it is not
needed.
|
protected abstract void |
doStart(org.apache.tools.ant.taskdefs.Java java)
Implementation of
RunnableContainer.start() that all
containers extending this class must implement. |
protected abstract void |
doStop(org.apache.tools.ant.taskdefs.Java java)
Implementation of
RunnableContainer.stop() that all
containers extending this class must implement. |
protected org.codehaus.cargo.util.AntUtils |
getAntUtils() |
String[] |
getExtraClasspath() |
org.codehaus.cargo.util.FileHandler |
getFileHandler() |
String |
getHome() |
protected HttpUtils |
getHttpUtils() |
protected JdkUtils |
getJdkUtils() |
protected ResourceUtils |
getResourceUtils() |
Map |
getSystemProperties() |
ContainerType |
getType() |
void |
setExtraClasspath(String[] classpath) |
void |
setFileHandler(org.codehaus.cargo.util.FileHandler fileHandler) |
void |
setHome(String home) |
void |
setLogger(org.codehaus.cargo.util.log.Logger logger)
Overriden in order to set the logger on ancillary components.
|
void |
setSystemProperties(Map properties) |
protected void |
startInternal()
Installed and Embedded containers do not have the same signature for their
doStart method. |
protected void |
stopInternal()
Installed and Embedded containers do not have the same signature for their
doStop method. |
protected void |
verify()
Verify required properties have been set before executing any action.
|
getConfiguration, getOutput, getState, getTimeout, isAppend, setAppend, setConfiguration, setOutput, setState, setTimeout, start, stop, waitForCompletion
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConfiguration, setConfiguration
getCapability, getId, getName, getState
getOutput, getTimeout, isAppend, setAppend, setOutput, setTimeout, start, stop
public AbstractInstalledLocalContainer(LocalConfiguration configuration)
configuration
- the configuration to associate to this container. It can be changed
later on by calling AbstractLocalContainer.setConfiguration(LocalConfiguration)
public void setLogger(org.codehaus.cargo.util.log.Logger logger)
setLogger
in interface org.codehaus.cargo.util.log.Loggable
setLogger
in class org.codehaus.cargo.util.log.LoggedObject
logger
- the logger to set and set in the ancillary objectsLoggable.setLogger(org.codehaus.cargo.util.log.Logger)
protected final HttpUtils getHttpUtils()
protected final JdkUtils getJdkUtils()
protected final org.codehaus.cargo.util.AntUtils getAntUtils()
protected final ResourceUtils getResourceUtils()
public org.codehaus.cargo.util.FileHandler getFileHandler()
public void setFileHandler(org.codehaus.cargo.util.FileHandler fileHandler)
fileHandler
- the Cargo file utility class to use. This method is useful for unit
testing with Mock objects as it can be passed a test file handler that doesn't perform
any real file action.public final void setHome(String home)
setHome
in interface InstalledLocalContainer
home
- the directory where the container is installed. Note that we're passing a String
instead of a File because we want to leave the possibility of using URIs for
specifying the home location.InstalledLocalContainer.setHome(String)
public void setSystemProperties(Map properties)
setSystemProperties
in interface SpawnedContainer
properties
- the System properties to set in the container executing VM.SpawnedContainer.setSystemProperties(java.util.Map)
public Map getSystemProperties()
getSystemProperties
in interface SpawnedContainer
SpawnedContainer.getSystemProperties()
public void setExtraClasspath(String[] classpath)
setExtraClasspath
in interface SpawnedContainer
classpath
- the extra classpath that is added to the container's classpath when it is
started.SpawnedContainer.setExtraClasspath(String[])
public String[] getExtraClasspath()
getExtraClasspath
in interface SpawnedContainer
SpawnedContainer.getExtraClasspath()
public final String getHome()
getHome
in interface InstalledLocalContainer
InstalledLocalContainer.getHome()
protected abstract void doStart(org.apache.tools.ant.taskdefs.Java java) throws Exception
RunnableContainer.start()
that all
containers extending this class must implement.java
- the predefined Ant Java
command to use to
start the containerException
- if any error is raised during the container startprotected abstract void doStop(org.apache.tools.ant.taskdefs.Java java) throws Exception
RunnableContainer.stop()
that all
containers extending this class must implement.java
- the predefined Ant Java
command to use to stop the containerException
- if any error is raised during the container stopprotected final void startInternal() throws Exception
doStart
method. Thus we need to abstract it.startInternal
in class AbstractLocalContainer
Exception
- if any error is raised during the container startAbstractLocalContainer.startInternal()
protected final void stopInternal() throws Exception
doStop
method. Thus we need to abstract it.stopInternal
in class AbstractLocalContainer
Exception
- if any error is raised during the container stopAbstractLocalContainer.stopInternal()
protected final void addToolsJarToClasspath(org.apache.tools.ant.types.Path classpath) throws FileNotFoundException
classpath
- the classpath object to which to add the tools.jarFileNotFoundException
- in case the tools.jar file cannot be
foundprotected void verify()
verify
in class AbstractLocalContainer
AbstractLocalContainer.verify()
public ContainerType getType()
getType
in interface Container
Container.getType()
Copyright © 2004-2013 Codehaus. All Rights Reserved.