org.codehaus.cargo.container.tomcat.internal
Class AbstractTomcatManagerDeployer

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.AbstractRemoteDeployer
              extended by org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer
All Implemented Interfaces:
org.codehaus.cargo.container.deployer.Deployer, org.codehaus.cargo.util.log.Loggable
Direct Known Subclasses:
AbstractTomcatManagerInstalledLocalDeployer, AbstractTomcatRemoteDeployer

public abstract class AbstractTomcatManagerDeployer
extends org.codehaus.cargo.container.spi.deployer.AbstractRemoteDeployer

Common code to perform both local or remote deployments using a Tomcat manager-based deployer.

Version:
$Id: AbstractTomcatManagerDeployer.java 1199 2006-11-01 13:42:10Z vmassol $

Constructor Summary
AbstractTomcatManagerDeployer(org.codehaus.cargo.container.Container container)
          Default initialization.
 
Method Summary
protected  TomcatManager createManager(org.codehaus.cargo.container.configuration.Configuration configuration)
          Creates a Tomcat manager wrapper from the specified configuration.
 void deploy(org.codehaus.cargo.container.deployable.Deployable deployable)
          
protected abstract  org.codehaus.cargo.container.configuration.Configuration getConfiguration()
           
protected  java.lang.String getPath(org.codehaus.cargo.container.deployable.Deployable deployable)
          Gets the webapp path for the specified deployable.
protected  TomcatManager getTomcatManager()
           
 java.lang.String list()
           
protected abstract  void performUndeploy(org.codehaus.cargo.container.deployable.Deployable deployable)
          Performs undeployment of deployable.
 void redeploy(org.codehaus.cargo.container.deployable.Deployable deployable)
          
 void start(org.codehaus.cargo.container.deployable.Deployable deployable)
          
 void stop(org.codehaus.cargo.container.deployable.Deployable deployable)
          
 void undeploy(org.codehaus.cargo.container.deployable.Deployable deployable)
          
 
Methods inherited from class org.codehaus.cargo.container.spi.deployer.AbstractRemoteDeployer
getType
 
Methods inherited from class org.codehaus.cargo.container.spi.deployer.AbstractDeployer
deploy, deploy
 
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

AbstractTomcatManagerDeployer

public AbstractTomcatManagerDeployer(org.codehaus.cargo.container.Container container)
Default initialization.

Parameters:
container - the container to which to deploy to
Method Detail

getConfiguration

protected abstract org.codehaus.cargo.container.configuration.Configuration getConfiguration()
Returns:
the configuration to use for deployment

getTomcatManager

protected TomcatManager getTomcatManager()
Returns:
the tomcat manager instance

deploy

public void deploy(org.codehaus.cargo.container.deployable.Deployable deployable)

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

undeploy

public void undeploy(org.codehaus.cargo.container.deployable.Deployable deployable)

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

performUndeploy

protected abstract void performUndeploy(org.codehaus.cargo.container.deployable.Deployable deployable)
                                 throws TomcatManagerException,
                                        java.io.IOException
Performs undeployment of deployable.

Note: This is done differently by the different versions of Tomcat which is why we're using an Abstract method here.

Parameters:
deployable - the Deployable to undeploy
Throws:
TomcatManagerException - If TomcatManagerException error occured perfoming the command
java.io.IOException - If I/O error occured getting the path of deployable

redeploy

public void redeploy(org.codehaus.cargo.container.deployable.Deployable deployable)

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

start

public void start(org.codehaus.cargo.container.deployable.Deployable deployable)

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

stop

public void stop(org.codehaus.cargo.container.deployable.Deployable deployable)

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

list

public java.lang.String list()
Returns:
the list of applications available in Tomcat and their statuses.

createManager

protected TomcatManager createManager(org.codehaus.cargo.container.configuration.Configuration configuration)
Creates a Tomcat manager wrapper from the specified configuration.

Parameters:
configuration - the configuration to construct the Tomcat manager wrapper from
Returns:
the Tomcat manager wrapper

getPath

protected java.lang.String getPath(org.codehaus.cargo.container.deployable.Deployable deployable)
Gets the webapp path for the specified deployable.

Parameters:
deployable - the deployable
Returns:
the webapp path for the specified deployable


Copyright © 2004-2009 Codehaus. All Rights Reserved.