Class AbstractJettyEmbeddedLocalContainer
- 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.jetty.internal.AbstractJettyEmbeddedLocalContainer
-
- All Implemented Interfaces:
Container
,EmbeddedLocalContainer
,RunnableContainer
,LocalContainer
,Loggable
- Direct Known Subclasses:
Jetty5xEmbeddedLocalContainer
,Jetty6xEmbeddedLocalContainer
public abstract class AbstractJettyEmbeddedLocalContainer extends AbstractEmbeddedLocalContainer
Common code for all Jetty embedded container implementations.
-
-
Constructor Summary
Constructors Constructor Description AbstractJettyEmbeddedLocalContainer(LocalConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
createServerObject()
Create a Jetty Server Object.protected void
doStop()
Implementation ofRunnableContainer.stop()
that all containers extending this class must implement.ContainerCapability
getCapability()
Object
getServer()
protected String
getVersion()
Returns the version of the Jetty installation.protected void
waitForCompletion(boolean waitForStarting)
CallsSystem.gc()
after container has stopped.-
Methods inherited from class org.codehaus.cargo.container.spi.AbstractEmbeddedLocalContainer
doStart, 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
-
server
protected Object server
Jetty Server object. Note that we use an Object as we're calling the Jetty API by introspection only. This is order not to have any dependency with the Jetty jar for building.
-
-
Constructor Detail
-
AbstractJettyEmbeddedLocalContainer
public AbstractJettyEmbeddedLocalContainer(LocalConfiguration configuration)
-
-
Method Detail
-
getServer
public Object getServer()
- Returns:
- the Jetty Server object
-
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 classAbstractEmbeddedLocalContainer
- Parameters:
waitForStarting
- iftrue
then wait for container start, iffalse
wait for container stop- Throws:
InterruptedException
- if the thread sleep is interrupted
-
createServerObject
protected void createServerObject() throws Exception
Create a Jetty Server Object.- Throws:
Exception
- in case of error
-
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).
-
doStop
protected void doStop() throws Exception
Implementation ofRunnableContainer.stop()
that all containers extending this class must implement.- Specified by:
doStop
in classAbstractEmbeddedLocalContainer
- Throws:
Exception
- if any error is raised during the container stop
-
getVersion
protected String getVersion()
Returns the version of the Jetty installation.- Returns:
- The Jetty version
-
-