Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs.optional.j2ee

public Class GenericHotDeploymentTool

extends AbstractHotDeploymentTool
Class Inheritance
Known Direct Subclasses
org.apache.tools.ant.taskdefs.optional.j2ee.JonasHotDeploymentTool
Imports
org.apache.tools.ant.BuildException, org.apache.tools.ant.taskdefs.Java, org.apache.tools.ant.types.Commandline

A generic tool for J2EE server hot deployment.

The simple implementation spawns a JVM with the supplied class name, jvm args, and arguments.

See Also
org.apache.tools.ant.taskdefs.optional.j2ee.HotDeploymentTool, org.apache.tools.ant.taskdefs.optional.j2ee.AbstractHotDeploymentTool, org.apache.tools.ant.taskdefs.optional.j2ee.ServerDeploy

Field Summary

Modifier and TypeField and Description
private String
className

The fully qualified class name of the deployment tool

private Java
java

A Java task used to run the deployment tool

private static final String[]
VALID_ACTIONS

List of valid actions

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Commandline.Argument

Returns:

A Commandline.Argument object representing the command line argument being passed when the deployment tool is run. IE: "-user=mark", "-password=venture"...
createArg
()

Add a nested argument element to hand to the deployment tool; optional.

public Commandline.Argument

Returns:

A Commandline.Argument object representing the JVM command line argument being passed when the deployment tool is run. IE: "-ms64m", "-mx128m"...
createJvmarg
()

Add a nested argument element to hand to the JVM running the deployment tool.

public void
public String

Returns:

the classname value.
getClassName
()

Get the classname attribute.

public Java

Returns:

the java attribute.
getJava
()

get the java attribute.

protected boolean

Returns:

true if the "action" attribute is valid, false if not.
isActionValid
()

Implements abstract org.apache.tools.ant.taskdefs.optional.j2ee.AbstractHotDeploymentTool.isActionValid.

Determines if the "action" attribute defines a valid action.
public void
setClassName(String
The fully qualified class name of the class to perform deployment.
className
)

The name of the class to execute to perform deployment; required.

public void
public void
Inherited from org.apache.tools.ant.taskdefs.optional.j2ee.AbstractHotDeploymentTool:
createClasspathgetClasspathgetPasswordgetServergetTaskgetUserNamesetClasspathsetPasswordsetServersetUserName

Field Detail

classNameback to summary
private String className

The fully qualified class name of the deployment tool

javaback to summary
private Java java

A Java task used to run the deployment tool

VALID_ACTIONSback to summary
private static final String[] VALID_ACTIONS

List of valid actions

Constructor Detail

GenericHotDeploymentToolback to summary
public GenericHotDeploymentTool()

Method Detail

createArgback to summary
public Commandline.Argument createArg()

Add a nested argument element to hand to the deployment tool; optional.

Returns:Commandline.Argument

A Commandline.Argument object representing the command line argument being passed when the deployment tool is run. IE: "-user=mark", "-password=venture"...

createJvmargback to summary
public Commandline.Argument createJvmarg()

Add a nested argument element to hand to the JVM running the deployment tool. Creates a nested arg element.

Returns:Commandline.Argument

A Commandline.Argument object representing the JVM command line argument being passed when the deployment tool is run. IE: "-ms64m", "-mx128m"...

deployback to summary
public void deploy() throws BuildException

Implements org.apache.tools.ant.taskdefs.optional.j2ee.HotDeploymentTool.deploy.

Perform the actual deployment. For this generic implementation, a JVM is spawned using the supplied classpath, classname, JVM args, and command line arguments.

Annotations
@Override
Exceptions
BuildException:
if the attributes are invalid or incomplete.
getClassNameback to summary
public String getClassName()

Get the classname attribute.

Returns:String

the classname value.

getJavaback to summary
public Java getJava()

get the java attribute.

Returns:Java

the java attribute.

isActionValidback to summary
protected boolean isActionValid()

Implements abstract org.apache.tools.ant.taskdefs.optional.j2ee.AbstractHotDeploymentTool.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. For this generic implementation, the only valid action is "deploy"

Returns:boolean

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

Annotations
@Override
setClassNameback to summary
public void setClassName(String className)

The name of the class to execute to perform deployment; required. Example: "com.foobar.tools.deploy.DeployTool"

Parameters
className:String

The fully qualified class name of the class to perform deployment.

setTaskback to summary
public void setTask(ServerDeploy task)

Overrides org.apache.tools.ant.taskdefs.optional.j2ee.AbstractHotDeploymentTool.setTask.

Implements org.apache.tools.ant.taskdefs.optional.j2ee.HotDeploymentTool.setTask.

Sets the parent task.

Parameters
task:ServerDeploy

An ServerDeploy object representing the parent task.

Annotations
@Override
validateAttributesback to summary
public void validateAttributes() throws BuildException

Overrides org.apache.tools.ant.taskdefs.optional.j2ee.AbstractHotDeploymentTool.validateAttributes.

Implements org.apache.tools.ant.taskdefs.optional.j2ee.HotDeploymentTool.validateAttributes.

Validates the passed in attributes. Ensures the className and arguments attribute have been set.

Annotations
@Override
Exceptions
BuildException:
if the attributes are invalid or incomplete.