Class Deployable
- java.lang.Object
-
- org.codehaus.cargo.maven3.configuration.AbstractDependency
-
- org.codehaus.cargo.maven3.configuration.Deployable
-
public class Deployable extends AbstractDependency
Holds configuration data for the<deployable>
tag used to configure the plugin in thepom.xml
file.
TODO: Find a way to remove code duplication with Ant's DeployableElement
-
-
Constructor Summary
Constructors Constructor Description Deployable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
computeExtension(String packaging)
Compute the extension for a given Maven 3 packaging.protected String
computeLocation(CargoProject project)
Compute the location of the current deployable.Deployable
createDeployable(String containerId, CargoProject project)
Create a deployable.String
getImplementation()
Long
getPingTimeout()
URL
getPingURL()
String
getPingUrlPath()
Map<String,String>
getProperties()
protected String
getSetterMethodName(String propertyName)
Transform a property into a method name by transforming the first letter of the property name to uppercase.protected boolean
isTypeCompatible(CargoProject project)
Checks if deployable type is compatible with the project's packaging.void
setImplementation(String implementation)
void
setProperties(Map<String,String> properties)
protected void
setPropertiesOnDeployable(Deployable deployable, CargoProject project)
Set user-defined properties on the created deployable.-
Methods inherited from class org.codehaus.cargo.maven3.configuration.AbstractDependency
equals, findArtifactLocation, getArtifactId, getClassifier, getGroupId, getLocation, getType, hashCode, setArtifactId, setClassifier, setGroupId, setLocation, setType, toString
-
-
-
-
Method Detail
-
setProperties
public void setProperties(Map<String,String> properties)
- Parameters:
properties
- Deployable properties.
-
getPingURL
public URL getPingURL()
- Returns:
- Ping URL.
-
getPingUrlPath
public String getPingUrlPath()
- Returns:
- Ping URL path.
-
getPingTimeout
public Long getPingTimeout()
- Returns:
- Ping timeout.
-
setImplementation
public void setImplementation(String implementation)
- Parameters:
implementation
- Implementation.
-
getImplementation
public String getImplementation()
- Returns:
- Implementation.
-
createDeployable
public Deployable createDeployable(String containerId, CargoProject project) throws org.apache.maven.plugin.MojoExecutionException
Create a deployable.- Parameters:
containerId
- Container identifier.project
- Cargo project.- Returns:
- Deployable.
- Throws:
org.apache.maven.plugin.MojoExecutionException
- If location computation or deployable instanciation fails.
-
setPropertiesOnDeployable
protected void setPropertiesOnDeployable(Deployable deployable, CargoProject project) throws org.apache.maven.plugin.MojoExecutionException
Set user-defined properties on the created deployable.- Parameters:
deployable
- the deployable on which to set the propertiesproject
- Cargo project.- Throws:
org.apache.maven.plugin.MojoExecutionException
- If property name is invalid for deployable type
-
computeLocation
protected String computeLocation(CargoProject project) throws org.apache.maven.plugin.MojoExecutionException
Compute the location of the current deployable.- Parameters:
project
- Cargo project.- Returns:
- Location of current deployable.
- Throws:
org.apache.maven.plugin.MojoExecutionException
- If location cannot be found.
-
isTypeCompatible
protected boolean isTypeCompatible(CargoProject project)
Checks if deployable type is compatible with the project's packaging.- Parameters:
project
- Cargo project.- Returns:
true
if the deployable type is compatible with the project's packaging.
-
computeExtension
protected String computeExtension(String packaging)
Compute the extension for a given Maven 3 packaging.- Parameters:
packaging
- Maven 3 project packaging (ex: ejb, ear, rar, war, etc)- Returns:
- Artifact extension matching the packaging
-
-