1 17 18 package org.objectweb.jonas.ant; 19 20 import java.io.File ; 21 import java.util.Enumeration ; 22 import java.util.Vector ; 23 import org.apache.tools.ant.BuildException; 24 import org.apache.tools.ant.Task; 25 import org.apache.tools.ant.taskdefs.optional.j2ee.GenericHotDeploymentTool; 26 import org.apache.tools.ant.taskdefs.optional.j2ee.WebLogicHotDeploymentTool; 27 28 36 public class ServerDeploy extends Task { 37 38 41 private String action; 42 43 46 private File source; 47 48 51 private Vector vendorTools = new Vector (); 52 53 59 64 public void addGeneric(GenericHotDeploymentTool tool) { 65 } 66 67 73 public void addWeblogic(WebLogicHotDeploymentTool tool) { 74 } 75 76 82 public void addJonas(JonasHotDeploymentTool tool) { 83 tool.setTask(this); 84 vendorTools.addElement(tool); 85 } 86 87 93 101 public void execute() throws BuildException { 102 for (Enumeration e = vendorTools.elements(); e.hasMoreElements();) { 103 HotDeploymentTool tool = (HotDeploymentTool) e.nextElement(); 104 tool.validateAttributes(); 105 tool.deploy(); 106 } 107 } 108 109 115 119 public String getAction() { 120 return action; 121 } 122 123 129 public void setAction(String action) { 130 this.action = action; 131 } 132 133 138 public File getSource() { 139 return source; 140 } 141 142 147 public void setSource(File source) { 148 this.source = source; 149 } 150 } | Popular Tags |