public abstract class AbstractHotDeploymentTool extends java.lang.Object implements HotDeploymentTool
isActionValid()
method to insure the
action supplied as the "action" attribute of ServerDeploy is valid.validateAttributes()
method to insure
all required attributes are supplied, and are in the correct format.add<TOOL>
method to the ServerDeploy
class. This method will be called when Ant encounters a
add<TOOL>
task nested in the
serverdeploy
task.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...HotDeploymentTool
,
ServerDeploy
ACTION_DELETE, ACTION_DEPLOY, ACTION_LIST, ACTION_UNDEPLOY, ACTION_UPDATE
Constructor and Description |
---|
AbstractHotDeploymentTool() |
Modifier and Type | Method and Description |
---|---|
Path |
createClasspath()
Add a classpath as a nested element.
|
abstract void |
deploy()
Perform the actual deployment.
|
Path |
getClasspath()
gets the classpath field.
|
java.lang.String |
getPassword()
Returns the password field.
|
java.lang.String |
getServer()
Returns the server field.
|
protected ServerDeploy |
getTask()
Returns the task field, a ServerDeploy object.
|
java.lang.String |
getUserName()
Returns the userName field.
|
protected abstract boolean |
isActionValid()
Determines if the "action" attribute defines a valid action.
|
void |
setClasspath(Path classpath)
The classpath to be passed to the JVM running the tool;
optional depending upon the tool.
|
void |
setPassword(java.lang.String password)
The password of the user; optional.
|
void |
setServer(java.lang.String server)
The address or URL for the server where the component will be deployed.
|
void |
setTask(ServerDeploy task)
Sets the parent task.
|
void |
setUserName(java.lang.String userName)
The user with privileges to deploy applications to the server; optional.
|
void |
validateAttributes()
Validates the passed in attributes.
|
public Path createClasspath()
protected abstract boolean isActionValid()
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.
public void validateAttributes() throws BuildException
Only the "action" attribute is required in the base class. Subclasses should check attributes accordingly.
validateAttributes
in interface HotDeploymentTool
BuildException
- if the attributes are invalid or incomplete.public abstract void deploy() throws BuildException
deploy
in interface HotDeploymentTool
BuildException
- if the attributes are invalid or incomplete.public void setTask(ServerDeploy task)
setTask
in interface HotDeploymentTool
task
- a ServerDeploy object representing the parent task.protected ServerDeploy getTask()
public Path getClasspath()
public void setClasspath(Path classpath)
classpath
- A Path object representing the "classpath" attribute.public java.lang.String getUserName()
public void setUserName(java.lang.String userName)
userName
- A String representing the "userName" attribute.public java.lang.String getPassword()
public void setPassword(java.lang.String password)
password
- A String representing the "password" attribute.public java.lang.String getServer()
public void setServer(java.lang.String server)
server
- A String representing the "server" attribute.