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 voidcreateServerObject()Create a Jetty Server Object.protected voiddoStop()Implementation ofRunnableContainer.stop()that all containers extending this class must implement.ContainerCapabilitygetCapability()ObjectgetServer()protected StringgetVersion()Returns the version of the Jetty installation.protected voidwaitForCompletion(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 InterruptedExceptionCallsSystem.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
-
createServerObject
protected void createServerObject() throws ExceptionCreate a Jetty Server Object.- Throws:
Exception- in case of error
-
getCapability
public ContainerCapability getCapability()
- Returns:
- the
ContainerCapabilityof the container in term of ability to deploy such and such type ofDeployables (eg WAR, EAR, etc).
-
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
-
getVersion
protected String getVersion()
Returns the version of the Jetty installation.- Returns:
- The Jetty version
-
-