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 String
managerContext
Context 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 TomcatManager
createManager(Configuration configuration)
Creates a Tomcat manager wrapper from the specified configuration.void
deploy(Deployable deployable)
Deploy aDeployable
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()
protected String
getVersion(Deployable deployable)
Gets the webapp version for the specified deployable.String
list()
protected abstract void
performUndeploy(Deployable deployable)
Performs undeployment of deployable.void
redeploy(Deployable deployable)
Redeploy aDeployable
already deployed to the running container.void
redeploy(Deployable deployable, DeployableMonitor monitor)
Redeploy aDeployable
already deployed to the running container.void
start(Deployable deployable)
Starts aDeployable
that is already deployed in the running container but that is not servicing requests.void
stop(Deployable deployable)
Stop aDeployable
that is already deployed in the running container in order to prevent it from servicing requests.void
undeploy(Deployable deployable)
Undeploy aDeployable
from 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 aDeployable
to the running container and make it available for requests.- Specified by:
deploy
in interfaceDeployer
- Overrides:
deploy
in classAbstractDeployer
- Parameters:
deployable
- theDeployable
to deploy
-
undeploy
public void undeploy(Deployable deployable)
Undeploy aDeployable
from the running container. The service becomes unavailable for requests.- Specified by:
undeploy
in interfaceDeployer
- Overrides:
undeploy
in classAbstractDeployer
- Parameters:
deployable
- theDeployable
to 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
- theDeployable
to 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
Deployable
already deployed to the running container. The service becomes available for requests.Note that this method will be unsupported by the
Deployer
s based on theAbstractCopyingInstalledLocalDeployer
.- Specified by:
redeploy
in interfaceDeployer
- Overrides:
redeploy
in classAbstractDeployer
- Parameters:
deployable
- theDeployable
to redeploy- See Also:
Deployer.deploy(Deployable)
,Deployer.undeploy(Deployable)
-
redeploy
public void redeploy(Deployable deployable, DeployableMonitor monitor)
Redeploy a
Deployable
already deployed to the running container. The service becomes available for requests.Note that this method will be unsupported by the
Deployer
s based on theAbstractCopyingInstalledLocalDeployer
.- Specified by:
redeploy
in interfaceDeployer
- Overrides:
redeploy
in classAbstractDeployer
- Parameters:
deployable
- theDeployable
to redeploymonitor
- the monitor that checks for deployment status- See Also:
Deployer.deploy(Deployable)
,Deployer.undeploy(Deployable)
-
start
public void start(Deployable deployable)
Starts aDeployable
that is already deployed in the running container but that is not servicing requests.- Specified by:
start
in interfaceDeployer
- Overrides:
start
in classAbstractDeployer
- Parameters:
deployable
- theDeployable
to start
-
stop
public void stop(Deployable deployable)
Stop aDeployable
that is already deployed in the running container in order to prevent it from servicing requests.- Specified by:
stop
in interfaceDeployer
- Overrides:
stop
in classAbstractDeployer
- Parameters:
deployable
- theDeployable
to 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
-
-