Package org.codehaus.cargo.maven3
Class AbstractDeployerMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.codehaus.cargo.maven3.AbstractCommonMojo
-
- org.codehaus.cargo.maven3.AbstractCargoMojo
-
- org.codehaus.cargo.maven3.AbstractDeployerMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
DeployerDeployMojo
,DeployerRedeployMojo
,DeployerStartMojo
,DeployerStopMojo
,DeployerUndeployMojo
public abstract class AbstractDeployerMojo extends AbstractCargoMojo
Common mojo for all deployer actions (start deployable, stop deployable, deploy deployable, undeploy deployable, etc).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
AbstractDeployerMojo.DeployerListener
DeployableMonitorListener
that logs.
-
Field Summary
-
Fields inherited from class org.codehaus.cargo.maven3.AbstractCargoMojo
CONTEXT_KEY_CLASSLOADER, CONTEXT_KEY_CONTAINER
-
-
Constructor Summary
Constructors Constructor Description AbstractDeployerMojo()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Deployer
createDeployer(Container container)
Create a deployer.protected DeployerFactory
createDeployerFactory()
void
doExecute()
Executes the plugin.protected abstract void
performDeployerActionOnSingleDeployable(Deployer deployer, Deployable deployable, DeployableMonitor monitor)
Perform a deployer action on a single deployable.-
Methods inherited from class org.codehaus.cargo.maven3.AbstractCargoMojo
calculateArtifact, calculateContainerArtifactId, createAutoDeployDeployable, createConfiguration, createContainer, createDefaultContainerElementIfNecessary, createDefaultInstallerElementIfNecessary, createLogger, createNewContainer, execute, getCargoProject, getConfigurationElement, getContainerElement, getDaemon, getDeployablesElement, getDeployerElement, isIgnoreFailures, setCargoProject, setConfigurationElement, setContainerElement, setDeployablesElement, setDeployerElement, setIgnoreFailures, waitDeployableMonitor
-
Methods inherited from class org.codehaus.cargo.maven3.AbstractCommonMojo
getProject
-
-
-
-
Method Detail
-
doExecute
public void doExecute() throws org.apache.maven.plugin.MojoExecutionException
Executes the plugin.This method must be implemented by all Mojos extending this class. The reason for this pattern is because we want the
AbstractCargoMojo.execute()
method to always be called so that necessary plugin initialization can be performed. Without this pattern Mojos extending this class could "forget" to callsuper.execute()
thus leading to unpredictible results.- Specified by:
doExecute
in classAbstractCargoMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
- in case of error
-
createDeployer
protected Deployer createDeployer(Container container) throws org.apache.maven.plugin.MojoExecutionException
Create a deployer.- Parameters:
container
- Container.- Returns:
- Deployer for
container
. - Throws:
org.apache.maven.plugin.MojoExecutionException
- If deployer creation fails.
-
createDeployerFactory
protected DeployerFactory createDeployerFactory()
- Returns:
- Deployer factory.
-
performDeployerActionOnSingleDeployable
protected abstract void performDeployerActionOnSingleDeployable(Deployer deployer, Deployable deployable, DeployableMonitor monitor)
Perform a deployer action on a single deployable.- Parameters:
deployer
- Deployer.deployable
- Deployable.monitor
- Deployable monitor.
-
-