public abstract class AbstractInstalledLocalContainer extends AbstractLocalContainer implements InstalledLocalContainer
| Constructor and Description |
|---|
AbstractInstalledLocalContainer(LocalConfiguration configuration)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addExtraClasspath(JvmLauncher java)
Add extra container classpath entries specified by the user.
|
void |
addExtraClasspath(String location) |
protected void |
addMemoryArguments(JvmLauncher java)
Adds the JVM memory arguments.
|
protected void |
addRuntimeArgs(JvmLauncher java)
Add command line arguments to the java command.
|
void |
addSharedClasspath(String location) |
protected void |
addToolsJarToClasspath(JvmLauncher java)
Adds the tools.jar to the classpath, except for Mac OSX as it is not needed.
|
protected JvmLauncher |
createJvmLauncher(boolean server)
Creates a preinitialized instance of a JVM launcher to be used for starting, stopping and
controlling the container.
|
protected abstract void |
doStart(JvmLauncher java)
Implementation of
RunnableContainer.start() that all
containers extending this class must implement. |
protected abstract void |
doStop(JvmLauncher java)
Implementation of
RunnableContainer.stop() that all
containers extending this class must implement. |
protected void |
forceStopInternal()
Some containers may not fully stop and need to be forcibly stopped.
|
protected AntUtils |
getAntUtils() |
String[] |
getExtraClasspath() |
String |
getHome() |
protected HttpUtils |
getHttpUtils() |
protected String |
getJavaHome()
Gets the Java home directory to use for this container.
|
protected JdkUtils |
getJdkUtils() |
JvmLauncherFactory |
getJvmLauncherFactory()
Gets the factory used to spawn the container JVM.
|
protected ResourceUtils |
getResourceUtils() |
String[] |
getSharedClasspath() |
Map<String,String> |
getSystemProperties() |
ContainerType |
getType() |
void |
ifPresentAddPathToList(String location,
List<String> list)
adds the location to the list, if the file exists.
|
void |
setExtraClasspath(String[] classpath) |
void |
setHome(String home) |
void |
setJvmLauncherFactory(JvmLauncherFactory jvmLauncherFactory)
Sets the factory used to spawn the container JVM.
|
protected void |
setJvmToLaunchContainerIn(JvmLauncher java)
Determines which java virtual machine will run the container.
|
void |
setLogger(Logger logger)
Overriden in order to set the logger on ancillary components.
|
void |
setSharedClasspath(String[] classpath) |
void |
setSystemProperties(Map<String,String> 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.
|
executePostStartTasks, getConfiguration, getFileHandler, getOutput, getState, getTimeout, isAppend, restart, setAppend, setConfiguration, setFileHandler, setOutput, setState, setTimeout, start, stop, waitForCompletiongetLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConfiguration, getFileHandler, setConfiguration, setFileHandlergetCapability, getId, getName, getStategetOutput, getTimeout, isAppend, restart, setAppend, setOutput, setTimeout, start, stoppublic 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(Logger logger)
setLogger in interface LoggablesetLogger in class LoggedObjectlogger - 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 AntUtils getAntUtils()
protected final ResourceUtils getResourceUtils()
public void setHome(String home)
setHome in interface InstalledLocalContainerhome - 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. IMPORTANT: While some containers can deal with this parameter being
set as a relative path, some others require this path to be set to an absolute directory.
Please refer to the documentation of the server to ensure you give the path in the
appropriate way. If in doubt, you can use absolute paths -that is known to work with all
containers.InstalledLocalContainer.setHome(String)public void setSystemProperties(Map<String,String> properties)
setSystemProperties in interface SpawnedContainerproperties - the System properties to set in the container executing VM.SpawnedContainer.setSystemProperties(java.util.Map<java.lang.String, java.lang.String>)public Map<String,String> getSystemProperties()
getSystemProperties in interface SpawnedContainerSpawnedContainer.getSystemProperties()public void setExtraClasspath(String[] classpath)
setExtraClasspath in interface SpawnedContainerclasspath - the extra classpath that is added to the container's classpath when it is
started.SpawnedContainer.setExtraClasspath(String[])public String[] getExtraClasspath()
getExtraClasspath in interface SpawnedContainerSpawnedContainer.getExtraClasspath()public void setSharedClasspath(String[] classpath)
setSharedClasspath in interface SpawnedContainerclasspath - the shared classpath that is shared by the container applications.InstalledLocalContainer.getHome()public String[] getSharedClasspath()
getSharedClasspath in interface SpawnedContainerSpawnedContainer.getSharedClasspath()public String getHome()
getHome in interface InstalledLocalContainerInstalledLocalContainer.getHome()public JvmLauncherFactory getJvmLauncherFactory()
getJvmLauncherFactory in interface SpawnedContainernull.public void setJvmLauncherFactory(JvmLauncherFactory jvmLauncherFactory)
setJvmLauncherFactory in interface SpawnedContainerjvmLauncherFactory - The factory used to spawn the container JVM, must not be
null.protected abstract void doStart(JvmLauncher java) throws Exception
RunnableContainer.start() that all
containers extending this class must implement.java - the predefined JVM launcher to use to start the containerException - if any error is raised during the container startprotected abstract void doStop(JvmLauncher java) throws Exception
RunnableContainer.stop() that all
containers extending this class must implement.java - the predefined JVM launcher 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 AbstractLocalContainerException - 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 AbstractLocalContainerException - if any error is raised during the container stopAbstractLocalContainer.stopInternal()protected final void forceStopInternal()
forceStopInternal in class AbstractLocalContainerAbstractLocalContainer.forceStopInternal()protected JvmLauncher createJvmLauncher(boolean server)
server - true to launch a server process, false to launch a
client/utility process.null.protected String getJavaHome()
null.protected void setJvmToLaunchContainerIn(JvmLauncher java)
java - the java command that will start the containerprotected final void addToolsJarToClasspath(JvmLauncher java) throws FileNotFoundException
java - the JVM launcher to which to add the tools.jarFileNotFoundException - in case the tools.jar file cannot be foundprotected void addExtraClasspath(JvmLauncher java)
java - the java command used to start/stop the containerprotected void addRuntimeArgs(JvmLauncher java)
java - The java commandprotected void addMemoryArguments(JvmLauncher java)
java - the predefined JVM launcher on which to add memory-related argumentsprotected void verify()
verify in class AbstractLocalContainerAbstractLocalContainer.verify()public ContainerType getType()
getType in interface ContainerContainer.getType()public void addExtraClasspath(String location)
addExtraClasspath in interface SpawnedContainerlocation - the extra classpath that is added to the container's classpath when it is
started.org.codehaus.cargo.container.SpawnedContainer#addExtraClasspath()public void addSharedClasspath(String location)
addSharedClasspath in interface SpawnedContainerlocation - the shared classpath that is added to the container's classpath when it is
started.org.codehaus.cargo.container.SpawnedContainer#addSharedClasspath()Copyright © 2004-2013 Codehaus. All Rights Reserved.