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 voidaddDeployedWebAppContext(String context, Object deployedWebApp)Add a new entry to the context path:deployable map.voiddeploy(Deployable deployable)Deploy aDeployableto the running container and make it available for requests.abstract ObjectdeployWebApp(Deployable deployable)Implement to perform the work of the deploy.static StringgetContext(Deployable deployable)Get the context path for the webapp.BooleangetCopyWebApp()protected static ObjectgetDeployedWebAppContext(Deployable deployable)Get the deployable that matches the context path.BooleangetExtractWar()BooleangetParentLoaderPriority()DeployerTypegetType()String[]getVirtualHosts()protected static voidremoveDeployedWebAppContext(String context)Take a map entry away using the key.voidsetCopyWebApp(Boolean copy)copy webapp.voidsetExtractWar(Boolean extract)If true, all wars deployed by this deployer will be extracted before being deployed.voidsetParentLoaderPriority(Boolean java2compliant)This is called java2classloadercompliance setting in jetty5 and the parentloaderpriority in jetty6.voidsetVirtualHosts(String[] hosts)Set a list of virtual hosts corresponding to the webapps deployed via this deployer.voidundeploy(Deployable deployable)Undeploy aDeployablefrom the running container.abstract voidundeployWebApp(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 aDeployableto the running container and make it available for requests.- Specified by:
deployin interfaceDeployer- Overrides:
deployin classAbstractDeployer- Parameters:
deployable- theDeployableto deploy
-
undeploy
public void undeploy(Deployable deployable)
Undeploy aDeployablefrom the running container. The service becomes unavailable for requests.- Specified by:
undeployin interfaceDeployer- Overrides:
undeployin classAbstractDeployer- Parameters:
deployable- theDeployableto undeploy
-
getType
public DeployerType getType()
- Specified by:
getTypein interfaceDeployer- Overrides:
getTypein 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
-
-