Class AbstractTomcatManagerDeployer
- java.lang.Object
-
- org.codehaus.cargo.util.log.LoggedObject
-
- org.codehaus.cargo.container.spi.deployer.AbstractDeployer
-
- org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer
-
- Direct Known Subclasses:
AbstractTomcatManagerInstalledLocalDeployer,AbstractTomcatRemoteDeployer
public abstract class AbstractTomcatManagerDeployer extends AbstractDeployer
Common code to perform both local or remote deployments using a Tomcat manager-based deployer.
-
-
Field Summary
Fields Modifier and Type Field Description protected StringmanagerContextContext where the Tomcat manager lives.
-
Constructor Summary
Constructors Constructor Description AbstractTomcatManagerDeployer(Container container)Default initialization.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected TomcatManagercreateManager(Configuration configuration)Creates a Tomcat manager wrapper from the specified configuration.voiddeploy(Deployable deployable)Deploy aDeployableto the running container and make it available for requests.protected abstract ConfigurationgetConfiguration()protected StringgetPath(Deployable deployable)Gets the webapp path for the specified deployable.protected TomcatManagergetTomcatManager()protected StringgetVersion(Deployable deployable)Gets the webapp version for the specified deployable.Stringlist()protected abstract voidperformUndeploy(Deployable deployable)Performs undeployment of deployable.voidredeploy(Deployable deployable)Redeploy aDeployablealready deployed to the running container.voidredeploy(Deployable deployable, DeployableMonitor monitor)Redeploy aDeployablealready deployed to the running container.voidstart(Deployable deployable)Starts aDeployablethat is already deployed in the running container but that is not servicing requests.voidstop(Deployable deployable)Stop aDeployablethat is already deployed in the running container in order to prevent it from servicing requests.voidundeploy(Deployable deployable)Undeploy aDeployablefrom the running container.-
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
-
-
-
-
Field Detail
-
managerContext
protected String managerContext
Context where the Tomcat manager lives.
-
-
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 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
-
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- theDeployableto undeploy- Throws:
TomcatManagerException- If TomcatManagerException error occured perfoming the commandIOException- If I/O error occured getting the path of deployable
-
redeploy
public void redeploy(Deployable deployable)
Redeploy a
Deployablealready deployed to the running container. The service becomes available for requests.Note that this method will be unsupported by the
Deployers based on theAbstractCopyingInstalledLocalDeployer.- Specified by:
redeployin interfaceDeployer- Overrides:
redeployin classAbstractDeployer- Parameters:
deployable- theDeployableto redeploy- See Also:
Deployer.deploy(Deployable),Deployer.undeploy(Deployable)
-
redeploy
public void redeploy(Deployable deployable, DeployableMonitor monitor)
Redeploy a
Deployablealready deployed to the running container. The service becomes available for requests.Note that this method will be unsupported by the
Deployers based on theAbstractCopyingInstalledLocalDeployer.- Specified by:
redeployin interfaceDeployer- Overrides:
redeployin classAbstractDeployer- Parameters:
deployable- theDeployableto redeploymonitor- the monitor that checks for deployment status- See Also:
Deployer.deploy(Deployable),Deployer.undeploy(Deployable)
-
start
public void start(Deployable deployable)
Starts aDeployablethat is already deployed in the running container but that is not servicing requests.- Specified by:
startin interfaceDeployer- Overrides:
startin classAbstractDeployer- Parameters:
deployable- theDeployableto start
-
stop
public void stop(Deployable deployable)
Stop aDeployablethat is already deployed in the running container in order to prevent it from servicing requests.- Specified by:
stopin interfaceDeployer- Overrides:
stopin classAbstractDeployer- Parameters:
deployable- theDeployableto stop
-
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
-
getVersion
protected String getVersion(Deployable deployable)
Gets the webapp version for the specified deployable.- Parameters:
deployable- the deployable- Returns:
- the webapp version for the specified deployable
-
-