Class Tomcat8xEmbeddedLocalContainer
- 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.AbstractEmbeddedLocalContainer
-
- org.codehaus.cargo.container.tomcat.internal.AbstractCatalinaEmbeddedLocalContainer
-
- org.codehaus.cargo.container.tomcat.Tomcat8xEmbeddedLocalContainer
-
- All Implemented Interfaces:
Container
,EmbeddedLocalContainer
,RunnableContainer
,LocalContainer
,Loggable
- Direct Known Subclasses:
Tomcat9xEmbeddedLocalContainer
public class Tomcat8xEmbeddedLocalContainer extends AbstractCatalinaEmbeddedLocalContainer
Embedded Tomcat 8.x container.
-
-
Field Summary
-
Fields inherited from class org.codehaus.cargo.container.tomcat.internal.AbstractCatalinaEmbeddedLocalContainer
connector, controller, host
-
-
Constructor Summary
Constructors Constructor Description Tomcat8xEmbeddedLocalContainer(LocalConfiguration configuration)
Creates a Tomcat 8.xEmbeddedLocalContainer
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doStop()
Implementation ofRunnableContainer.stop()
that all containers extending this class must implement.ClassLoader
getClassLoader()
Tomcat 8.x has a weird class called TomcatURLStreamHandlerFactory where the singleton has a staticinstance
field and a final attributeregistered
which are not always in sync and cause unexpected exceptions.String
getId()
String
getName()
protected void
prepareController(TomcatEmbedded wrapper, File home, int port)
Prepare the Tomcat controller.-
Methods inherited from class org.codehaus.cargo.container.tomcat.internal.AbstractCatalinaEmbeddedLocalContainer
doStart, getCapability, getController, getHost, scheduleDeployment, waitForCompletion
-
Methods inherited from class org.codehaus.cargo.container.spi.AbstractEmbeddedLocalContainer
getType, setClassLoader, startInternal, stopInternal
-
Methods inherited from class org.codehaus.cargo.container.spi.AbstractLocalContainer
executePostStartTasks, forceStopInternal, getConfiguration, getFileHandler, getOutput, getState, getTimeout, isAppend, restart, setAppend, setConfiguration, setFileHandler, setOutput, setState, setTimeout, start, stop, verify, waitForPortShutdown, waitForStarting
-
Methods inherited from class org.codehaus.cargo.util.log.LoggedObject
getLogger, setLogger
-
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
-
Tomcat8xEmbeddedLocalContainer
public Tomcat8xEmbeddedLocalContainer(LocalConfiguration configuration)
Creates a Tomcat 8.xEmbeddedLocalContainer
.- Parameters:
configuration
- the configuration of the newly created container.
-
-
Method Detail
-
getId
public String getId()
- Returns:
- the short name of the container. Note: this is not a unique id. It is simply the name in a computer-usable format.
-
getName
public String getName()
- Returns:
- the human readable name of the Container (ex: "Resin 3.x", "JBoss 3.0.8", etc).
-
prepareController
protected void prepareController(TomcatEmbedded wrapper, File home, int port)
Prepare the Tomcat controller. After this method returns, thehost
andconnector
protected attributes must be set.- Specified by:
prepareController
in classAbstractCatalinaEmbeddedLocalContainer
- Parameters:
wrapper
- Tomcat wrapper.home
-CATALINA_BASE
directory.port
- HTTP port.
-
doStop
protected void doStop() throws Exception
Implementation ofRunnableContainer.stop()
that all containers extending this class must implement.- Overrides:
doStop
in classAbstractCatalinaEmbeddedLocalContainer
- Throws:
Exception
- if any error is raised during the container stop
-
getClassLoader
public ClassLoader getClassLoader()
Tomcat 8.x has a weird class called TomcatURLStreamHandlerFactory where the singleton has a staticinstance
field and a final attributeregistered
which are not always in sync and cause unexpected exceptions. Save old class loaders in order to avoid trouble when the container is executed twice (for example, in CARGO's integration tests).- Specified by:
getClassLoader
in interfaceEmbeddedLocalContainer
- Overrides:
getClassLoader
in classAbstractEmbeddedLocalContainer
- Returns:
- the custom classloader to use for loading the Embedded container's classes.
-
-