FileDocCategorySizeDatePackage
ServerDeploy.javaAPI DocApache Ant 1.705421Wed Dec 13 06:16:18 GMT 2006org.apache.tools.ant.taskdefs.optional.j2ee

ServerDeploy

public class ServerDeploy extends org.apache.tools.ant.Task
Controls hot deployment tools for J2EE servers. This class is used as a framework for the creation of vendor specific hot deployment tools.
see
org.apache.tools.ant.taskdefs.optional.j2ee.HotDeploymentTool
see
org.apache.tools.ant.taskdefs.optional.j2ee.AbstractHotDeploymentTool
see
org.apache.tools.ant.taskdefs.optional.j2ee.GenericHotDeploymentTool
see
org.apache.tools.ant.taskdefs.optional.j2ee.WebLogicHotDeploymentTool

Fields Summary
private String
action
The action to be performed. IE: "deploy", "delete", etc...
private File
source
The source (fully-qualified path) to the component being deployed
private Vector
vendorTools
The vendor specific tool for deploying the component
Constructors Summary
Methods Summary
public voidaddGeneric(GenericHotDeploymentTool tool)
Creates a generic deployment tool.

Ant calls this method on creation to handle embedded "generic" elements in the ServerDeploy task.

param
tool An instance of GenericHotDeployment tool, passed in by Ant.


    ///////////////////////////////////////////////////////////////////////////
    //
    // Place vendor specific tool creations here.
    //
    ///////////////////////////////////////////////////////////////////////////

                                            
        
        tool.setTask(this);
        vendorTools.addElement(tool);
    
public voidaddJonas(JonasHotDeploymentTool tool)
Creates a JOnAS deployment tool, for deployment to JOnAS servers.

Ant calls this method on creation to handle embedded "jonas" elements in the ServerDeploy task.

param
tool An instance of JonasHotDeployment tool, passed in by Ant.

        tool.setTask(this);
        vendorTools.addElement(tool);
    
public voidaddWeblogic(WebLogicHotDeploymentTool tool)
Creates a WebLogic deployment tool, for deployment to WebLogic servers.

Ant calls this method on creation to handle embedded "weblogic" elements in the ServerDeploy task.

param
tool An instance of WebLogicHotDeployment tool, passed in by Ant.

        tool.setTask(this);
        vendorTools.addElement(tool);
    
public voidexecute()
Execute the task.

This method calls the deploy() method on each of the vendor-specific tools in the vendorTools collection. This performs the actual process of deployment on each tool.

exception
org.apache.tools.ant.BuildException if the attributes are invalid or incomplete, or a failure occurs in the deployment process.

        for (Enumeration e = vendorTools.elements();
             e.hasMoreElements();) {
            HotDeploymentTool tool = (HotDeploymentTool) e.nextElement();
            tool.validateAttributes();
            tool.deploy();
        }
    
public java.lang.StringgetAction()
Returns the action field.

return
A string representing the "action" attribute.

        return action;
    
public java.io.FilegetSource()
Returns the source field (the path/filename of the component to be deployed.

return
A File object representing the "source" attribute.

        return source;
    
public voidsetAction(java.lang.String action)
The action to be performed, usually "deploy"; required. Some tools support additional actions, such as "delete", "list", "undeploy", "update"...

param
action A String representing the "action" attribute.

        this.action = action;
    
public voidsetSource(java.io.File source)
The filename of the component to be deployed; optional depending upon the tool and the action.

param
source String representing the "source" attribute.

        this.source = source;