org.codehaus.cargo.container.jetty.internal
Class AbstractJettyEmbeddedLocalDeployer

java.lang.Object
  extended by org.codehaus.cargo.util.log.LoggedObject
      extended by org.codehaus.cargo.container.spi.deployer.AbstractDeployer
          extended by org.codehaus.cargo.container.spi.deployer.AbstractLocalDeployer
              extended by org.codehaus.cargo.container.spi.deployer.AbstractEmbeddedLocalDeployer
                  extended by org.codehaus.cargo.container.jetty.internal.AbstractJettyEmbeddedLocalDeployer
All Implemented Interfaces:
Deployer, Loggable
Direct Known Subclasses:
Jetty4xEmbeddedLocalDeployer, Jetty5xEmbeddedLocalDeployer, Jetty6xEmbeddedLocalDeployer

public abstract class AbstractJettyEmbeddedLocalDeployer
extends AbstractEmbeddedLocalDeployer

Base class for all Jetty deployers.

Version:
$Id: AbstractJettyEmbeddedLocalDeployer.java 1264 2007-01-11 14:09:07Z janb $

Constructor Summary
AbstractJettyEmbeddedLocalDeployer(EmbeddedLocalContainer container)
          
 
Method Summary
protected static void addDeployedWebAppContext(java.lang.String context, java.lang.Object deployedWebApp)
          Add a new entry to the context path:deployable map.
 void deploy(Deployable deployable)
          
abstract  java.lang.Object deployWebApp(Deployable deployable)
          Implement to perform the work of the deploy.
static java.lang.String getContext(Deployable deployable)
          Get the context path for the webapp.
 java.lang.Boolean getCopyWebApp()
           
protected static java.lang.Object getDeployedWebAppContext(Deployable deployable)
          Get the deployable that matches the context path.
 java.lang.Boolean getExtractWar()
           
 java.lang.Boolean getParentLoaderPriority()
           
 DeployerType getType()
          
 java.lang.String[] getVirtualHosts()
           
protected static void removeDeployedWebAppContext(java.lang.String context)
          Take a map entry away using the key.
 void setCopyWebApp(java.lang.Boolean copy)
          copy webapp.
 void setExtractWar(java.lang.Boolean extract)
          If true, all wars deployed by this deployer will be extracted before being deployed.
 void setParentLoaderPriority(java.lang.Boolean java2compliant)
          This is called java2classloadercompliance setting in jetty5 and the parentloaderpriority in jetty6.
 void setVirtualHosts(java.lang.String[] hosts)
          Set a list of virtual hosts corresponding to the webapps deployed via this deployer.
 void undeploy(Deployable deployable)
          
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, setFileHandler
 
Methods inherited from class org.codehaus.cargo.container.spi.deployer.AbstractDeployer
deploy, deploy, redeploy, start, stop
 
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.util.log.Loggable
getLogger, setLogger
 

Constructor Detail

AbstractJettyEmbeddedLocalDeployer

public AbstractJettyEmbeddedLocalDeployer(EmbeddedLocalContainer container)

See Also:
AbstractEmbeddedLocalDeployer.AbstractEmbeddedLocalDeployer(org.codehaus.cargo.container.EmbeddedLocalContainer)
Method Detail

deployWebApp

public abstract java.lang.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)

Specified by:
deploy in interface Deployer
Overrides:
deploy in class AbstractDeployer
See Also:
Deployer.deploy(org.codehaus.cargo.container.deployable.Deployable)

undeploy

public void undeploy(Deployable deployable)

Specified by:
undeploy in interface Deployer
Overrides:
undeploy in class AbstractDeployer
See Also:
Deployer.undeploy(org.codehaus.cargo.container.deployable.Deployable)

getType

public DeployerType getType()

Specified by:
getType in interface Deployer
Overrides:
getType in class AbstractEmbeddedLocalDeployer
See Also:
Deployer.getType()

setVirtualHosts

public void setVirtualHosts(java.lang.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 java.lang.String[] getVirtualHosts()
Returns:
the virtual hosts

setExtractWar

public void setExtractWar(java.lang.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 java.lang.Boolean getExtractWar()
Returns:
whether to extract or not

setCopyWebApp

public void setCopyWebApp(java.lang.Boolean copy)
copy webapp. If true, unpacked wars will be copied to a tmp location so their jars can be replaced at runtime

Parameters:
copy - if true, webapps are copied to tmp dir

getCopyWebApp

public java.lang.Boolean getCopyWebApp()
Returns:
wether to copy unpacked war or not

setParentLoaderPriority

public void setParentLoaderPriority(java.lang.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 java.lang.Boolean getParentLoaderPriority()
Returns:
the class loader priority

getDeployedWebAppContext

protected static java.lang.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(java.lang.String context,
                                               java.lang.Object deployedWebApp)
Add a new entry to the context path:deployable map.

Parameters:
context - the contextpath for the webapp
deployedWebApp - the jetty webapp object

removeDeployedWebAppContext

protected static void removeDeployedWebAppContext(java.lang.String context)
Take a map entry away using the key.

Parameters:
context - the context path

getContext

public static java.lang.String getContext(Deployable deployable)
Get the context path for the webapp.

Parameters:
deployable - the deployable
Returns:
the context path


Copyright © 2004-2011 Codehaus. All Rights Reserved.