1 18 19 package org.apache.tools.ant.taskdefs.optional.j2ee; 20 21 import java.io.File ; 22 import java.util.Enumeration ; 23 import java.util.Vector ; 24 import org.apache.tools.ant.BuildException; 25 import org.apache.tools.ant.Task; 26 27 38 public class ServerDeploy extends Task { 39 40 private String action; 41 42 43 private File source; 44 45 46 private Vector vendorTools = new Vector (); 47 48 54 60 public void addGeneric(GenericHotDeploymentTool tool) { 61 tool.setTask(this); 62 vendorTools.addElement(tool); 63 } 64 65 71 public void addWeblogic(WebLogicHotDeploymentTool tool) { 72 tool.setTask(this); 73 vendorTools.addElement(tool); 74 } 75 76 82 public void addJonas(JonasHotDeploymentTool tool) { 83 tool.setTask(this); 84 vendorTools.addElement(tool); 85 } 86 87 88 94 102 public void execute() throws BuildException { 103 for (Enumeration e = vendorTools.elements(); 104 e.hasMoreElements();) { 105 HotDeploymentTool tool = (HotDeploymentTool) e.nextElement(); 106 tool.validateAttributes(); 107 tool.deploy(); 108 } 109 } 110 111 117 121 public String getAction() { 122 return action; 123 } 124 125 130 public void setAction(String action) { 131 this.action = action; 132 } 133 134 139 public File getSource() { 140 return source; 141 } 142 143 148 public void setSource(File source) { 149 this.source = source; 150 } 151 } 152 153 | Popular Tags |