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:
Deployer, Loggable
Direct Known Subclasses:
AbstractTomcatManagerInstalledLocalDeployer, AbstractTomcatRemoteDeployer

public abstract class AbstractTomcatManagerDeployer
extends AbstractRemoteDeployer

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

Version:
$Id: AbstractTomcatManagerDeployer.java 1709 2008-09-09 16:53:25Z mwringe $

Constructor Summary
AbstractTomcatManagerDeployer(Container container)
          Default initialization.
 
Method Summary
protected  TomcatManager createManager(Configuration configuration)
          Creates a Tomcat manager wrapper from the specified configuration.
 void deploy(Deployable deployable)
          Deploy a Deployable to the running container and make it available for requests.
protected abstract  Configuration getConfiguration()
           
protected  String getPath(Deployable deployable)
          Gets the webapp path for the specified deployable.
protected  TomcatManager getTomcatManager()
           
 String list()
           
protected abstract  void performUndeploy(Deployable deployable)
          Performs undeployment of deployable.
 void redeploy(Deployable deployable)
          Redeploy a Deployable already deployed to the running container.
 void start(Deployable deployable)
          Starts a Deployable that is already deployed in the running container but that is not servicing requests.
 void stop(Deployable deployable)
          Stop a Deployable that is already deployed in the running container in order to prevent it from servicing requests.
 void undeploy(Deployable deployable)
          Undeploy a Deployable from the running container.
 
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, undeploy
 
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(Container container)
Default initialization.

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

getConfiguration

protected abstract Configuration getConfiguration()
Returns:
the configuration to use for deployment

getTomcatManager

protected TomcatManager getTomcatManager()
Returns:
the tomcat manager instance

deploy

public void deploy(Deployable deployable)
Deploy a Deployable to the running container and make it available for requests.

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

undeploy

public void undeploy(Deployable deployable)
Undeploy a Deployable from the running container. The service becomes unavailable for requests.

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

performUndeploy

protected abstract void performUndeploy(Deployable deployable)
                                 throws TomcatManagerException,
                                        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
IOException - If I/O error occured getting the path of deployable

redeploy

public void redeploy(Deployable deployable)

Redeploy a Deployable already deployed to the running container. The service becomes available for requests.

Note that this method will be unsupported by the Deployers based on the AbstractCopyingInstalledLocalDeployer.

Specified by:
redeploy in interface Deployer
Overrides:
redeploy in class AbstractDeployer
Parameters:
deployable - the Deployable to redeploy
See Also:
Deployer.redeploy(org.codehaus.cargo.container.deployable.Deployable)

start

public void start(Deployable deployable)
Starts a Deployable that is already deployed in the running container but that is not servicing requests.

Specified by:
start in interface Deployer
Overrides:
start in class AbstractDeployer
Parameters:
deployable - the Deployable to start
See Also:
Deployer.start(org.codehaus.cargo.container.deployable.Deployable)

stop

public void stop(Deployable deployable)
Stop a Deployable that is already deployed in the running container in order to prevent it from servicing requests.

Specified by:
stop in interface Deployer
Overrides:
stop in class AbstractDeployer
Parameters:
deployable - the Deployable to stop
See Also:
Deployer.stop(org.codehaus.cargo.container.deployable.Deployable)

list

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

createManager

protected TomcatManager createManager(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 String getPath(Deployable deployable)
Gets the webapp path for the specified deployable.

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


Copyright © 2004-2012 Codehaus. All Rights Reserved.