Class AbstractCatalinaInstalledLocalContainer
- java.lang.Object
-
- org.codehaus.cargo.util.log.LoggedObject
-
- org.codehaus.cargo.container.spi.AbstractContainer
-
- org.codehaus.cargo.container.spi.AbstractLocalContainer
-
- org.codehaus.cargo.container.spi.AbstractInstalledLocalContainer
-
- org.codehaus.cargo.container.tomcat.internal.AbstractCatalinaInstalledLocalContainer
-
- All Implemented Interfaces:
Container
,InstalledLocalContainer
,RunnableContainer
,SpawnedContainer
,LocalContainer
,Loggable
- Direct Known Subclasses:
Tomcat4xInstalledLocalContainer
,Tomcat5xInstalledLocalContainer
,Tomcat6xInstalledLocalContainer
,Tomcat7xInstalledLocalContainer
public abstract class AbstractCatalinaInstalledLocalContainer extends AbstractInstalledLocalContainer
Base support for Catalina based installed local containers.
-
-
Constructor Summary
Constructors Constructor Description AbstractCatalinaInstalledLocalContainer(LocalConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addExtraClasspath(JvmLauncher java)
Configures the extra classpath if we are not on anAbstractCatalinaStandaloneLocalConfiguration
, does nothing otherwise.void
doStart(JvmLauncher java)
Implementation ofRunnableContainer.start()
that all containers extending this class must implement.void
doStop(JvmLauncher java)
Implementation ofRunnableContainer.stop()
that all containers extending this class must implement.ContainerCapability
getCapability()
protected String
getVersion(String defaultVersion)
Returns the version of the Tomcat installation.protected void
invokeContainer(String action, JvmLauncher java)
Invokes the container bootstrap class to start or stop the container, depending on the value of the provided argument.-
Methods inherited from class org.codehaus.cargo.container.spi.AbstractInstalledLocalContainer
addExtraClasspath, addMemoryArguments, addRuntimeArgs, addSharedClasspath, addToolsJarToClasspath, createJvmLauncher, forceStopInternal, getExtraClasspath, getHome, getHttpUtils, getJavaHome, getJvmLauncherFactory, getResourceUtils, getSharedClasspath, getSystemProperties, getType, ifPresentAddPathToList, setExtraClasspath, setHome, setJvmLauncherFactory, setJvmToLaunchContainerIn, setLogger, setSharedClasspath, setSystemProperties, startInternal, stopInternal, verify
-
Methods inherited from class org.codehaus.cargo.container.spi.AbstractLocalContainer
executePostStartTasks, getConfiguration, getFileHandler, getOutput, getState, getTimeout, isAppend, restart, setAppend, setConfiguration, setFileHandler, setOutput, setState, setTimeout, start, stop, waitForCompletion, waitForPortShutdown, waitForStarting
-
Methods inherited from class org.codehaus.cargo.util.log.LoggedObject
getLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.codehaus.cargo.container.LocalContainer
getConfiguration, getFileHandler, setConfiguration, setFileHandler
-
Methods inherited from interface org.codehaus.cargo.container.internal.RunnableContainer
getOutput, getTimeout, isAppend, restart, setAppend, setOutput, setTimeout, start, stop
-
-
-
-
Constructor Detail
-
AbstractCatalinaInstalledLocalContainer
public AbstractCatalinaInstalledLocalContainer(LocalConfiguration configuration)
-
-
Method Detail
-
getVersion
protected String getVersion(String defaultVersion)
Returns the version of the Tomcat installation.- Parameters:
defaultVersion
- default version to use if we cannot find out the exact Tomcat version- Returns:
- The Tomcat version, or
null
if the version number could not be retrieved
-
getCapability
public ContainerCapability getCapability()
- Returns:
- the
ContainerCapability
of the container in term of ability to deploy such and such type ofDeployable
s (eg WAR, EAR, etc).
-
doStart
public void doStart(JvmLauncher java) throws Exception
Implementation ofRunnableContainer.start()
that all containers extending this class must implement.- Specified by:
doStart
in classAbstractInstalledLocalContainer
- Parameters:
java
- the predefined JVM launcher to use to start the container- Throws:
Exception
- if any error is raised during the container start
-
doStop
public void doStop(JvmLauncher java) throws Exception
Implementation ofRunnableContainer.stop()
that all containers extending this class must implement.- Specified by:
doStop
in classAbstractInstalledLocalContainer
- Parameters:
java
- the predefined JVM launcher to use to stop the container- Throws:
Exception
- if any error is raised during the container stop
-
addExtraClasspath
protected void addExtraClasspath(JvmLauncher java)
Configures the extra classpath if we are not on anAbstractCatalinaStandaloneLocalConfiguration
, does nothing otherwise. That is because, if we are in anAbstractCatalinaStandaloneLocalConfiguration
, the JARs in the extra classpath are copied over tocommon/lib
for the Tomcat bootstrap to load them. Add extra container classpath entries specified by the user.- Overrides:
addExtraClasspath
in classAbstractInstalledLocalContainer
- Parameters:
java
- the java command used to start/stop the container
-
invokeContainer
protected void invokeContainer(String action, JvmLauncher java) throws Exception
Invokes the container bootstrap class to start or stop the container, depending on the value of the provided argument.- Parameters:
action
- Either 'start' or 'stop'java
- the prepared Ant Java command that will be executed- Throws:
Exception
- in case of container invocation error
-
-