Class AbstractCatalinaEmbeddedLocalContainer
- 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
-
- All Implemented Interfaces:
Container,EmbeddedLocalContainer,RunnableContainer,LocalContainer,Loggable
- Direct Known Subclasses:
Tomcat5xEmbeddedLocalContainer,Tomcat8xEmbeddedLocalContainer
public abstract class AbstractCatalinaEmbeddedLocalContainer extends AbstractEmbeddedLocalContainer
Base support for Catalina based embedded local containers.
-
-
Field Summary
Fields Modifier and Type Field Description protected TomcatEmbedded.ConnectorconnectorTomcat connector object.protected TomcatEmbedded.EmbeddedcontrollerRoot of the Tomcat object model.protected TomcatEmbedded.HosthostTomcat host object.
-
Constructor Summary
Constructors Constructor Description AbstractCatalinaEmbeddedLocalContainer(LocalConfiguration configuration)Creates a TomcatEmbeddedLocalContainer.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voiddoStart()Implementation ofRunnableContainer.start()that all containers extending this class must implement.protected voiddoStop()Implementation ofRunnableContainer.stop()that all containers extending this class must implement.ContainerCapabilitygetCapability()TomcatEmbedded.EmbeddedgetController()TomcatEmbedded.HostgetHost()protected abstract voidprepareController(TomcatEmbedded wrapper, File home, int port)Prepare the Tomcat controller.voidscheduleDeployment(Deployable deployable)Used byTomcatEmbeddedLocalDeployerto registerDeployables that are to be deployed once the container is started.protected voidwaitForCompletion(boolean waitForStarting)Embedded Tomcat's start method is synchronous, so no need for waiting when starting.-
Methods inherited from class org.codehaus.cargo.container.spi.AbstractEmbeddedLocalContainer
getClassLoader, 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
-
-
-
-
Field Detail
-
controller
protected TomcatEmbedded.Embedded controller
Root of the Tomcat object model.
-
host
protected TomcatEmbedded.Host host
Tomcat host object.
-
connector
protected TomcatEmbedded.Connector connector
Tomcat connector object.
-
-
Constructor Detail
-
AbstractCatalinaEmbeddedLocalContainer
public AbstractCatalinaEmbeddedLocalContainer(LocalConfiguration configuration)
Creates a TomcatEmbeddedLocalContainer.- Parameters:
configuration- the configuration of the newly created container.
-
-
Method Detail
-
getController
public TomcatEmbedded.Embedded getController()
- Returns:
- the Tomcat controller object. Always non-null.
-
getHost
public TomcatEmbedded.Host getHost()
- Returns:
- the Tomcat host object. Always non-null.
-
doStart
protected void doStart() throws ExceptionImplementation ofRunnableContainer.start()that all containers extending this class must implement.- Specified by:
doStartin classAbstractEmbeddedLocalContainer- Throws:
Exception- if any error is raised during the container start
-
waitForCompletion
protected void waitForCompletion(boolean waitForStarting) throws InterruptedExceptionEmbedded Tomcat's start method is synchronous, so no need for waiting when starting. CallsSystem.gc()after container has stopped. Ping the WAR CPC to verify if the container is started or stopped.- Overrides:
waitForCompletionin classAbstractEmbeddedLocalContainer- Parameters:
waitForStarting- iftruethen wait for container start, iffalsewait for container stop- Throws:
InterruptedException- if the thread sleep is interrupted
-
doStop
protected void doStop() throws ExceptionImplementation ofRunnableContainer.stop()that all containers extending this class must implement.- Specified by:
doStopin classAbstractEmbeddedLocalContainer- Throws:
Exception- if any error is raised during the container stop
-
getCapability
public ContainerCapability getCapability()
- Returns:
- the
ContainerCapabilityof the container in term of ability to deploy such and such type ofDeployables (eg WAR, EAR, etc).
-
scheduleDeployment
public void scheduleDeployment(Deployable deployable)
Used byTomcatEmbeddedLocalDeployerto registerDeployables that are to be deployed once the container is started.- Parameters:
deployable-Deployableto be deployed later.
-
prepareController
protected abstract void prepareController(TomcatEmbedded wrapper, File home, int port)
Prepare the Tomcat controller. After this method returns, thehostandconnectorprotected attributes must be set.- Parameters:
wrapper- Tomcat wrapper.home-CATALINA_BASEdirectory.port- HTTP port.
-
-