org.objectweb.jonas.ant
Class JonasHotDeploymentTool

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.objectweb.jonas.ant.BootstrapTask
              extended by org.objectweb.jonas.ant.JonasHotDeploymentTool
All Implemented Interfaces:
HotDeploymentTool

public class JonasHotDeploymentTool
extends BootstrapTask
implements HotDeploymentTool

Class used to manage deployment on JOnAS (with ant and ServerDeploy task)

Author:
Florent Benoit

Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Fields inherited from interface org.objectweb.jonas.ant.HotDeploymentTool
ACTION_DELETE, ACTION_DEPLOY, ACTION_LIST, ACTION_UNDEPLOY, ACTION_UPDATE
 
Constructor Summary
JonasHotDeploymentTool()
           
 
Method Summary
 void deploy()
          Perform the actual deployment.
protected  ServerDeploy getTask()
          Returns the task field, a ServerDeploy object.
protected  boolean isActionValid()
          Determines if the "action" attribute defines a valid action.
 void setTask(ServerDeploy task)
          Sets the parent task.
 void validateAttributes()
          Validates the passed in attributes.
 
Methods inherited from class org.objectweb.jonas.ant.BootstrapTask
createClasspath, getBootstraptask, getCatalinaHome, getDomainName, getJettyHome, getJonasRoot, getServerName, getTaskName, setCatalinaHome, setClasspath, setDomainName, setJettyHome, setJonasbase, setJonasRoot, setJvmopts, setServerName, setTaskName
 
Methods inherited from class org.apache.tools.ant.Task
execute, getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JonasHotDeploymentTool

public JonasHotDeploymentTool()
Method Detail

validateAttributes

public void validateAttributes()
                        throws org.apache.tools.ant.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
Throws:
org.apache.tools.ant.BuildException - if the attributes are invalid or incomplete.

setTask

public void setTask(ServerDeploy task)
Sets the parent task.

Specified by:
setTask in interface HotDeploymentTool
Parameters:
task - a ServerDeploy object representing the parent task.

getTask

protected ServerDeploy getTask()
Returns the task field, a ServerDeploy object.

Returns:
An ServerDeploy representing the parent task.

isActionValid

protected 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:
true if the "action" attribute is valid, false if not.

deploy

public void deploy()
            throws org.apache.tools.ant.BuildException
Perform the actual deployment. It's up to the subclasses to implement the actual behavior.

Specified by:
deploy in interface HotDeploymentTool
Throws:
org.apache.tools.ant.BuildException - if the attributes are invalid or incomplete.