Package org.codehaus.cargo.container.spi
Class AbstractEmbeddedLocalContainer
- 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
-
- All Implemented Interfaces:
Container,EmbeddedLocalContainer,RunnableContainer,LocalContainer,Loggable
- Direct Known Subclasses:
AbstractCatalinaEmbeddedLocalContainer,AbstractJettyEmbeddedLocalContainer
public abstract class AbstractEmbeddedLocalContainer extends AbstractLocalContainer implements EmbeddedLocalContainer
Default container implementation that all local embedded container implementations must extend.
-
-
Constructor Summary
Constructors Constructor Description AbstractEmbeddedLocalContainer(LocalConfiguration configuration)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voiddoStart()Implementation ofRunnableContainer.start()that all containers extending this class must implement.protected abstract voiddoStop()Implementation ofRunnableContainer.stop()that all containers extending this class must implement.ClassLoadergetClassLoader()ContainerTypegetType()voidsetClassLoader(ClassLoader classLoader)protected voidstartInternal()Installed and Embedded containers do not have the same signature for theirdoStartmethod.protected voidstopInternal()Installed and Embedded containers do not have the same signature for theirdoStopmethod.protected voidwaitForCompletion(boolean waitForStarting)CallsSystem.gc()after container has stopped.-
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.Container
getCapability, getId, getName, getState
-
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
-
AbstractEmbeddedLocalContainer
public AbstractEmbeddedLocalContainer(LocalConfiguration configuration)
-
-
Method Detail
-
setClassLoader
public void setClassLoader(ClassLoader classLoader)
- Specified by:
setClassLoaderin interfaceEmbeddedLocalContainer- Parameters:
classLoader- the custom classloader to use for loading the Embedded container's classes.
-
getClassLoader
public ClassLoader getClassLoader()
- Specified by:
getClassLoaderin interfaceEmbeddedLocalContainer- Returns:
- the custom classloader to use for loading the Embedded container's classes.
-
startInternal
protected void startInternal() throws ExceptionInstalled and Embedded containers do not have the same signature for theirdoStartmethod. Thus we need to abstract it.- Specified by:
startInternalin classAbstractLocalContainer- Throws:
Exception- if any error is raised during the container start
-
stopInternal
protected void stopInternal() throws ExceptionInstalled and Embedded containers do not have the same signature for theirdoStopmethod. Thus we need to abstract it.- Specified by:
stopInternalin classAbstractLocalContainer- Throws:
Exception- if any error is raised during the container stop
-
doStart
protected abstract void doStart() throws ExceptionImplementation ofRunnableContainer.start()that all containers extending this class must implement.- Throws:
Exception- if any error is raised during the container start
-
doStop
protected abstract void doStop() throws ExceptionImplementation ofRunnableContainer.stop()that all containers extending this class must implement.- Throws:
Exception- if any error is raised during the container stop
-
waitForCompletion
protected void waitForCompletion(boolean waitForStarting) throws InterruptedExceptionCallsSystem.gc()after container has stopped. Ping the WAR CPC to verify if the container is started or stopped.- Overrides:
waitForCompletionin classAbstractLocalContainer- Parameters:
waitForStarting- iftruethen wait for container start, iffalsewait for container stop- Throws:
InterruptedException- if the thread sleep is interrupted
-
getType
public ContainerType getType()
-
-