Class AbstractHotDeploymentTool

All Implemented Interfaces:
Direct Known Subclasses:
GenericHotDeploymentTool, WebLogicHotDeploymentTool

public abstract class AbstractHotDeploymentTool extends Object implements HotDeploymentTool
Abstract class to support vendor-specific hot deployment tools. This class will validate boilerplate attributes. Subclassing this class for a vendor specific tool involves the following.
  1. Implement the isActionValid() method to insure the action supplied as the "action" attribute of ServerDeploy is valid.
  2. Implement the validateAttributes() method to insure all required attributes are supplied, and are in the correct format.
  3. Add a add<TOOL> method to the ServerDeploy class. This method will be called when Ant encounters a add<TOOL> task nested in the serverdeploy task.
  4. Define the deploy method. This method should perform whatever task it takes to hot-deploy the component. IE: spawn a JVM and run class, exec a native executable, run Java code...
See Also:
  • Constructor Details

    • AbstractHotDeploymentTool

      public AbstractHotDeploymentTool()
  • Method Details

    • createClasspath

      public Path createClasspath()
      Add a classpath as a nested element.
      A Path object representing the classpath to be used.
    • isActionValid

      protected abstract boolean isActionValid()
      Determines if the "action" attribute defines a valid action.

      Subclasses should determine if the action passed in is supported by the vendor's deployment tool.

      Actions may by "deploy", "delete", etc... It all depends on the tool.

      true if the "action" attribute is valid, false if not.
    • validateAttributes

      public void validateAttributes() throws BuildException
      Validates the passed in attributes. Subclasses should chain to this super-method to insure validation of boilerplate attributes.

      Only the "action" attribute is required in the base class. Subclasses should check attributes accordingly.

      Specified by:
      validateAttributes in interface HotDeploymentTool
      BuildException - if the attributes are invalid or incomplete.
    • setTask

      public void setTask(ServerDeploy task)
      Sets the parent task.
      Specified by:
      setTask in interface HotDeploymentTool
      task - a ServerDeploy object representing the parent task.
    • getTask

      protected ServerDeploy getTask()
      Returns the task field, a ServerDeploy object.
      An ServerDeploy representing the parent task.
    • getClasspath

      public Path getClasspath()
      gets the classpath field.
      A Path representing the "classpath" attribute.
    • setClasspath

      public void setClasspath(Path classpath)
      The classpath to be passed to the JVM running the tool; optional depending upon the tool. The classpath may also be supplied as a nested element.
      classpath - A Path object representing the "classpath" attribute.
    • getUserName

      public String getUserName()
      Returns the userName field.
      A String representing the "userName" attribute.
    • setUserName

      public void setUserName(String userName)
      The user with privileges to deploy applications to the server; optional.
      userName - A String representing the "userName" attribute.
    • getPassword

      public String getPassword()
      Returns the password field.
      A String representing the "password" attribute.
    • setPassword

      public void setPassword(String password)
      The password of the user; optional.
      password - A String representing the "password" attribute.
    • getServer

      public String getServer()
      Returns the server field.
      A String representing the "server" attribute.
    • setServer

      public void setServer(String server)
      The address or URL for the server where the component will be deployed.
      server - A String representing the "server" attribute.