Class AbstractJettyEmbeddedLocalDeployer
- java.lang.Object
-
- org.codehaus.cargo.util.log.LoggedObject
-
- org.codehaus.cargo.container.spi.deployer.AbstractDeployer
-
- org.codehaus.cargo.container.spi.deployer.AbstractLocalDeployer
-
- org.codehaus.cargo.container.spi.deployer.AbstractEmbeddedLocalDeployer
-
- org.codehaus.cargo.container.jetty.internal.AbstractJettyEmbeddedLocalDeployer
-
- Direct Known Subclasses:
Jetty5xEmbeddedLocalDeployer
,Jetty6xEmbeddedLocalDeployer
,Jetty7x8x9x10x11xEmbeddedLocalDeployer
public abstract class AbstractJettyEmbeddedLocalDeployer extends AbstractEmbeddedLocalDeployer
Base class for all Jetty deployers.
-
-
Constructor Summary
Constructors Constructor Description AbstractJettyEmbeddedLocalDeployer(EmbeddedLocalContainer container)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static void
addDeployedWebAppContext(String context, Object deployedWebApp)
Add a new entry to the context path:deployable map.void
deploy(Deployable deployable)
Deploy aDeployable
to the running container and make it available for requests.abstract Object
deployWebApp(Deployable deployable)
Implement to perform the work of the deploy.static String
getContext(Deployable deployable)
Get the context path for the webapp.Boolean
getCopyWebApp()
protected static Object
getDeployedWebAppContext(Deployable deployable)
Get the deployable that matches the context path.Boolean
getExtractWar()
Boolean
getParentLoaderPriority()
DeployerType
getType()
String[]
getVirtualHosts()
protected static void
removeDeployedWebAppContext(String context)
Take a map entry away using the key.void
setCopyWebApp(Boolean copy)
copy webapp.void
setExtractWar(Boolean extract)
If true, all wars deployed by this deployer will be extracted before being deployed.void
setParentLoaderPriority(Boolean java2compliant)
This is called java2classloadercompliance setting in jetty5 and the parentloaderpriority in jetty6.void
setVirtualHosts(String[] hosts)
Set a list of virtual hosts corresponding to the webapps deployed via this deployer.void
undeploy(Deployable deployable)
Undeploy aDeployable
from the running container.abstract void
undeployWebApp(Deployable deployable)
Implement to perform the work of the undeploy.-
Methods inherited from class org.codehaus.cargo.container.spi.deployer.AbstractLocalDeployer
getContainer, getFileHandler
-
Methods inherited from class org.codehaus.cargo.container.spi.deployer.AbstractDeployer
deploy, deploy, redeploy, redeploy, redeploy, start, start, stop, stop, undeploy
-
Methods inherited from class org.codehaus.cargo.util.log.LoggedObject
getLogger, setLogger
-
-
-
-
Constructor Detail
-
AbstractJettyEmbeddedLocalDeployer
public AbstractJettyEmbeddedLocalDeployer(EmbeddedLocalContainer container)
-
-
Method Detail
-
deployWebApp
public abstract Object deployWebApp(Deployable deployable)
Implement to perform the work of the deploy.- Parameters:
deployable
- the deployable- Returns:
- the webapp object that was deployed
-
undeployWebApp
public abstract void undeployWebApp(Deployable deployable)
Implement to perform the work of the undeploy.- Parameters:
deployable
- the webapp to undeploy
-
deploy
public void deploy(Deployable deployable)
Deploy aDeployable
to the running container and make it available for requests.- Specified by:
deploy
in interfaceDeployer
- Overrides:
deploy
in classAbstractDeployer
- Parameters:
deployable
- theDeployable
to deploy
-
undeploy
public void undeploy(Deployable deployable)
Undeploy aDeployable
from the running container. The service becomes unavailable for requests.- Specified by:
undeploy
in interfaceDeployer
- Overrides:
undeploy
in classAbstractDeployer
- Parameters:
deployable
- theDeployable
to undeploy
-
getType
public DeployerType getType()
- Specified by:
getType
in interfaceDeployer
- Overrides:
getType
in classAbstractEmbeddedLocalDeployer
- Returns:
- the deployer's type (local, remote, etc)
-
setVirtualHosts
public void setVirtualHosts(String[] hosts)
Set a list of virtual hosts corresponding to the webapps deployed via this deployer.- Parameters:
hosts
- list of virtual host names
-
getVirtualHosts
public String[] getVirtualHosts()
- Returns:
- the virtual hosts
-
setExtractWar
public void setExtractWar(Boolean extract)
If true, all wars deployed by this deployer will be extracted before being deployed. If false, they won't be extracted first. If null, jetty will do the default.- Parameters:
extract
- true=extract; false=don't extract, null=do container default
-
getExtractWar
public Boolean getExtractWar()
- Returns:
- whether to extract or not
-
setCopyWebApp
public void setCopyWebApp(Boolean copy)
copy webapp.- Parameters:
copy
- if true, unpacked wars will be copied to a tmp location so their jars can be replaced at runtime
-
getCopyWebApp
public Boolean getCopyWebApp()
- Returns:
- wether to copy unpacked war or not
-
setParentLoaderPriority
public void setParentLoaderPriority(Boolean java2compliant)
This is called java2classloadercompliance setting in jetty5 and the parentloaderpriority in jetty6. If true, the webapp classloader will try the parent. classloader first.- Parameters:
java2compliant
- true=inverted loading, false=servlet spec, null=do the container default
-
getParentLoaderPriority
public Boolean getParentLoaderPriority()
- Returns:
- the class loader priority
-
getDeployedWebAppContext
protected static Object getDeployedWebAppContext(Deployable deployable)
Get the deployable that matches the context path.- Parameters:
deployable
- the deployable object- Returns:
- the webapp object
-
addDeployedWebAppContext
protected static void addDeployedWebAppContext(String context, Object deployedWebApp)
Add a new entry to the context path:deployable map.- Parameters:
context
- the contextpath for the webappdeployedWebApp
- the jetty webapp object
-
removeDeployedWebAppContext
protected static void removeDeployedWebAppContext(String context)
Take a map entry away using the key.- Parameters:
context
- the context path
-
getContext
public static String getContext(Deployable deployable)
Get the context path for the webapp.- Parameters:
deployable
- the deployable- Returns:
- the context path
-
-