Class Deployable


  • public class Deployable
    extends AbstractDependency
    Holds configuration data for the <deployable> tag used to configure the plugin in the pom.xml file.

    TODO: Find a way to remove code duplication with Ant's DeployableElement
    • Constructor Detail

      • Deployable

        public Deployable()
    • Method Detail

      • getProperties

        public Map<String,​String> getProperties()
        Returns:
        Deployable properties.
      • 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)
        Set user-defined properties on the created deployable.
        Parameters:
        deployable - the deployable on which to set the properties
        project - Cargo project.
      • 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 Maven2 packaging.
        Parameters:
        packaging - Maven2 project packaging (ex: ejb, ear, rar, war, etc)
        Returns:
        Artifact extension matching the packaging
      • getSetterMethodName

        protected String getSetterMethodName​(String propertyName)
        Transform a property into a method name by transforming the first letter of the property name to uppercase.
        Parameters:
        propertyName - Property name to transform into a setter method
        Returns:
        Setter method's name