org.codehaus.cargo.container.spi.deployer
Class AbstractSwitchableLocalDeployer

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.AbstractInstalledLocalDeployer
                  extended by org.codehaus.cargo.container.spi.deployer.AbstractSwitchableLocalDeployer
All Implemented Interfaces:
Deployer, Loggable

public abstract class AbstractSwitchableLocalDeployer
extends AbstractInstalledLocalDeployer

Implementation decides how to deploy or undeploy based on the running state of the server.

Version:
$Id: $

Constructor Summary
AbstractSwitchableLocalDeployer(InstalledLocalContainer container)
          
 
Method Summary
 void deploy(Deployable deployable)
          Deploy a Deployable to the running container and make it available for requests.
protected abstract  Deployer getColdDeployer()
          this deployer will be used when the server is not running.
protected abstract  Deployer getHotDeployer()
          this deployer will be used when the server is running.
 void undeploy(Deployable deployable)
          Undeploy a Deployable from the running container.
 
Methods inherited from class org.codehaus.cargo.container.spi.deployer.AbstractInstalledLocalDeployer
getType
 
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, 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

AbstractSwitchableLocalDeployer

public AbstractSwitchableLocalDeployer(InstalledLocalContainer container)

See Also:
AbstractInstalledLocalDeployer.AbstractInstalledLocalDeployer(org.codehaus.cargo.container.LocalContainer)
Method Detail

getHotDeployer

protected abstract Deployer getHotDeployer()
this deployer will be used when the server is running.

Returns:
deployer used when server is up

getColdDeployer

protected abstract Deployer getColdDeployer()
this deployer will be used when the server is not running.

Returns:
deployer used when server is down

deploy

public void deploy(Deployable deployable)
Deploy a Deployable to the running container and make it available for requests. deploys via hotDeployer, if the server is started or starting. Otherwise, it uses the coldDeployer.

Specified by:
deploy in interface Deployer
Overrides:
deploy in class AbstractDeployer
Parameters:
deployable - - what to deploy
See Also:
AbstractDeployer.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. undeploys via hotDeployer, if the server is started or starting. Otherwise, it uses the coldDeployer.

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


Copyright © 2004-2011 Codehaus. All Rights Reserved.