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 void
doStart()
Implementation ofRunnableContainer.start()
that all containers extending this class must implement.protected abstract void
doStop()
Implementation ofRunnableContainer.stop()
that all containers extending this class must implement.ClassLoader
getClassLoader()
ContainerType
getType()
void
setClassLoader(ClassLoader classLoader)
protected void
startInternal()
Installed and Embedded containers do not have the same signature for theirdoStart
method.protected void
stopInternal()
Installed and Embedded containers do not have the same signature for theirdoStop
method.protected void
waitForCompletion(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:
setClassLoader
in interfaceEmbeddedLocalContainer
- Parameters:
classLoader
- the custom classloader to use for loading the Embedded container's classes.
-
getClassLoader
public ClassLoader getClassLoader()
- Specified by:
getClassLoader
in interfaceEmbeddedLocalContainer
- Returns:
- the custom classloader to use for loading the Embedded container's classes.
-
startInternal
protected void startInternal() throws Exception
Installed and Embedded containers do not have the same signature for theirdoStart
method. Thus we need to abstract it.- Specified by:
startInternal
in classAbstractLocalContainer
- Throws:
Exception
- if any error is raised during the container start
-
stopInternal
protected void stopInternal() throws Exception
Installed and Embedded containers do not have the same signature for theirdoStop
method. Thus we need to abstract it.- Specified by:
stopInternal
in classAbstractLocalContainer
- Throws:
Exception
- if any error is raised during the container stop
-
doStart
protected abstract void doStart() throws Exception
Implementation 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 Exception
Implementation 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 InterruptedException
CallsSystem.gc()
after container has stopped. Ping the WAR CPC to verify if the container is started or stopped.- Overrides:
waitForCompletion
in classAbstractLocalContainer
- Parameters:
waitForStarting
- iftrue
then wait for container start, iffalse
wait for container stop- Throws:
InterruptedException
- if the thread sleep is interrupted
-
getType
public ContainerType getType()
-
-