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

public abstract Class AbstractHotDeploymentTool

extends Object
implements HotDeploymentTool
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.taskdefs.optional.j2ee.HotDeploymentTool
Known Direct Subclasses
org.apache.tools.ant.taskdefs.optional.j2ee.GenericHotDeploymentTool, org.apache.tools.ant.taskdefs.optional.j2ee.WebLogicHotDeploymentTool
Imports
org.apache.tools.ant.BuildException, org.apache.tools.ant.types.Path

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
org.apache.tools.ant.taskdefs.optional.j2ee.HotDeploymentTool, org.apache.tools.ant.taskdefs.optional.j2ee.ServerDeploy

Field Summary

Modifier and TypeField and Description
private Path
classpath

The classpath passed to the JVM on execution.

private String
password

The password for the deployment server.

private String
server

The address of the deployment server

private ServerDeploy
task

The parent task

private String
userName

The username for the deployment server.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Path

Returns:

A Path object representing the classpath to be used.
createClasspath
()

Add a classpath as a nested element.

public Path

Returns:

A Path representing the "classpath" attribute.
getClasspath
()

gets the classpath field.

public String

Returns:

A String representing the "password" attribute.
getPassword
()

Returns the password field.

public String

Returns:

A String representing the "server" attribute.
getServer
()

Returns the server field.

protected ServerDeploy

Returns:

An ServerDeploy representing the parent task.
getTask
()

Returns the task field, a ServerDeploy object.

public String

Returns:

A String representing the "userName" attribute.
getUserName
()

Returns the userName field.

protected abstract boolean

Returns:

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

Determines if the "action" attribute defines a valid action.

public void
setClasspath(Path
A Path object representing the "classpath" attribute.
classpath
)

The classpath to be passed to the JVM running the tool; optional depending upon the tool.

public void
setPassword(String
A String representing the "password" attribute.
password
)

The password of the user; optional.

public void
setServer(String
A String representing the "server" attribute.
server
)

The address or URL for the server where the component will be deployed.

public void
setTask(ServerDeploy
a ServerDeploy object representing the parent task.
task
)

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

Sets the parent task.
public void
setUserName(String
A String representing the "userName" attribute.
userName
)

The user with privileges to deploy applications to the server; optional.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classpathback to summary
private Path classpath

The classpath passed to the JVM on execution.

passwordback to summary
private String password

The password for the deployment server.

serverback to summary
private String server

The address of the deployment server

taskback to summary
private ServerDeploy task

The parent task

userNameback to summary
private String userName

The username for the deployment server.

Constructor Detail

AbstractHotDeploymentToolback to summary
public AbstractHotDeploymentTool()

Method Detail

createClasspathback to summary
public Path createClasspath()

Add a classpath as a nested element.

Returns:Path

A Path object representing the classpath to be used.

getClasspathback to summary
public Path getClasspath()

gets the classpath field.

Returns:Path

A Path representing the "classpath" attribute.

getPasswordback to summary
public String getPassword()

Returns the password field.

Returns:String

A String representing the "password" attribute.

getServerback to summary
public String getServer()

Returns the server field.

Returns:String

A String representing the "server" attribute.

getTaskback to summary
protected ServerDeploy getTask()

Returns the task field, a ServerDeploy object.

Returns:ServerDeploy

An ServerDeploy representing the parent task.

getUserNameback to summary
public String getUserName()

Returns the userName field.

Returns:String

A String representing the "userName" attribute.

isActionValidback to summary
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.

Returns:boolean

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

setClasspathback to summary
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.

Parameters
classpath:Path

A Path object representing the "classpath" attribute.

setPasswordback to summary
public void setPassword(String password)

The password of the user; optional.

Parameters
password:String

A String representing the "password" attribute.

setServerback to summary
public void setServer(String server)

The address or URL for the server where the component will be deployed.

Parameters
server:String

A String representing the "server" attribute.

setTaskback to summary
public void setTask(ServerDeploy task)

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

Sets the parent task.

Parameters
task:ServerDeploy

a ServerDeploy object representing the parent task.

Annotations
@Override
setUserNameback to summary
public void setUserName(String userName)

The user with privileges to deploy applications to the server; optional.

Parameters
userName:String

A String representing the "userName" attribute.

validateAttributesback to summary
public void validateAttributes() throws BuildException

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

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.

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