JonasHotDeploymentTool (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.taskdefs.optional.j2ee, class: JonasHotDeploymentTool

# Class JonasHotDeploymentTool

java.lang.Object
org.apache.tools.ant.taskdefs.optional.j2ee.AbstractHotDeploymentTool
org.apache.tools.ant.taskdefs.optional.j2ee.GenericHotDeploymentTool
org.apache.tools.ant.taskdefs.optional.j2ee.JonasHotDeploymentTool

All Implemented Interfaces:
  `HotDeploymentTool`

public class JonasHotDeploymentTool extends GenericHotDeploymentTool implements HotDeploymentTool
An Ant wrapper task for the weblogic.deploy tool. This is used to hot-deploy J2EE applications to a running WebLogic server. This is not the same as creating the application archive. This task assumes the archive (EAR, JAR, or WAR) file has been assembled and is supplied as the "source" attribute.

In the end, this task assembles the commandline parameters and runs the weblogic.deploy tool in a separate JVM.

See Also:
  - `HotDeploymentTool`
  - `AbstractHotDeploymentTool`
  - `ServerDeploy`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected static final String`
  `DEFAULT_ORB`
  Description of the Field

  ### Fields inherited from interface HotDeploymentTool

  `ACTION_DELETE, ACTION_DEPLOY, ACTION_LIST, ACTION_UNDEPLOY, ACTION_UPDATE`
  Modifier and Type
  Field
  Description
  `static final String`
  `ACTION_DELETE`
  The delete action String
  `static final String`
  `ACTION_DEPLOY`
  The deploy action String
  `static final String`
  `ACTION_LIST`
  The list action String
  `static final String`
  `ACTION_UNDEPLOY`
  The undeploy action String
  `static final String`
  `ACTION_UPDATE`
  The update action String

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JonasHotDeploymentTool()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Path`
  `getClasspath()`
  gets the classpath field.
  `protected boolean`
  `isActionValid()`
  Determines if the action supplied is valid.
  `void`
  `setDavidhost(String inValue)`
  Set the host for the David ORB; required if ORB==david.
  `void`
  `setDavidport(int inValue)`
  Set the port for the David ORB; required if ORB==david.
  `void`
  `setJonasroot(File inValue)`
  set the jonas root directory (-Dinstall.root=).
  `void`
  `setOrb(String inValue)`
  Choose your ORB : RMI, JEREMIE, DAVID, ...; optional.
  `void`
  `validateAttributes()`
  Validates the passed in attributes.

  ### Methods inherited from class GenericHotDeploymentTool

  `createArg, createJvmarg, deploy, getClassName, getJava, setClassName, setTask`
  Modifier and Type
  Method
  Description
  `Commandline.Argument`
  `createArg()`
  Add a nested argument element to hand to the deployment tool; optional.
  `Commandline.Argument`
  `createJvmarg()`
  Add a nested argument element to hand to the JVM running the deployment tool.
  `void`
  `deploy()`
  Perform the actual deployment.
  `String`
  `getClassName()`
  Get the classname attribute.
  `Java`
  `getJava()`
  get the java attribute.
  `void`
  `setClassName(String className)`
  The name of the class to execute to perform deployment; required.
  `void`
  `setTask(ServerDeploy task)`
  Sets the parent task.

  ### Methods inherited from class AbstractHotDeploymentTool

  `createClasspath, getPassword, getServer, getTask, getUserName, setClasspath, setPassword, setServer, setUserName`
  Modifier and Type
  Method
  Description
  `Path`
  `createClasspath()`
  Add a classpath as a nested element.
  `String`
  `getPassword()`
  Returns the password field.
  `String`
  `getServer()`
  Returns the server field.
  `protected ServerDeploy`
  `getTask()`
  Returns the task field, a ServerDeploy object.
  `String`
  `getUserName()`
  Returns the userName field.
  `void`
  `setClasspath(Path classpath)`
  The classpath to be passed to the JVM running the tool; optional depending upon the tool.
  `void`
  `setPassword(String password)`
  The password of the user; optional.
  `void`
  `setServer(String server)`
  The address or URL for the server where the component will be deployed.
  `void`
  `setUserName(String userName)`
  The user with privileges to deploy applications to the server; optional.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### DEFAULT_ORB

    protected static final String DEFAULT_ORB
    Description of the Field
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### JonasHotDeploymentTool

    public JonasHotDeploymentTool()

- ## Method Details

  - ### setDavidhost

    public void setDavidhost(String inValue)
    Set the host for the David ORB; required if ORB==david.
    Parameters:
      `inValue` - The new davidhost value

  - ### setDavidport

    public void setDavidport(int inValue)
    Set the port for the David ORB; required if ORB==david.
    Parameters:
      `inValue` - The new davidport value

  - ### setJonasroot

    public void setJonasroot(File inValue)
    set the jonas root directory (-Dinstall.root=). This element is required.
    Parameters:
      `inValue` - The new jonasroot value

  - ### setOrb

    public void setOrb(String inValue)
    Choose your ORB : RMI, JEREMIE, DAVID, ...; optional. If omitted, it defaults to the one present in classpath. The corresponding JOnAS JAR is automatically added to the classpath. If your orb is DAVID (RMI/IIOP) you must specify davidhost and davidport properties.
    Parameters:
      `inValue` - RMI, JEREMIE, DAVID,...

  - ### getClasspath

    public Path getClasspath()
    gets the classpath field.
    Overrides:
      `getClasspath` in class `AbstractHotDeploymentTool`
    Returns:
      A Path representing the "classpath" attribute.

  - ### validateAttributes

    public void validateAttributes() throws BuildException
    Validates the passed in attributes.

    The rules are:

    1. If action is "deploy" or "update" the "application" and "source" attributes must be supplied.
    2. If action is "delete" or "undeploy" the "application" attribute must be supplied.
    Specified by:
      `validateAttributes` in interface `HotDeploymentTool`
    Overrides:
      `validateAttributes` in class `GenericHotDeploymentTool`
    Throws:
      `BuildException` - if something goes wrong

  - ### isActionValid

    protected boolean isActionValid()
    Determines if the action supplied is valid.

    Valid actions are contained in the static array VALID_ACTIONS

    Overrides:
      `isActionValid` in class `GenericHotDeploymentTool`
    Returns:
      true if the action attribute is valid, false if not.