00001
00018 package org.objectweb.jonas.ant;
00019
00020 import java.io.File;
00021 import java.util.Enumeration;
00022 import java.util.Vector;
00023 import org.apache.tools.ant.BuildException;
00024 import org.apache.tools.ant.Task;
00025 import org.apache.tools.ant.taskdefs.optional.j2ee.GenericHotDeploymentTool;
00026 import org.apache.tools.ant.taskdefs.optional.j2ee.WebLogicHotDeploymentTool;
00027
00036 public class ServerDeploy extends Task {
00037
00041 private String action;
00042
00046 private File source;
00047
00051 private Vector vendorTools = new Vector();
00052
00054
00055
00056
00058
00064 public void addGeneric(GenericHotDeploymentTool tool) {
00065 }
00066
00073 public void addWeblogic(WebLogicHotDeploymentTool tool) {
00074 }
00075
00082 public void addJonas(JonasHotDeploymentTool tool) {
00083 tool.setTask(this);
00084 vendorTools.addElement(tool);
00085 }
00086
00088
00089
00090
00092
00101 public void execute() throws BuildException {
00102 for (Enumeration e = vendorTools.elements(); e.hasMoreElements();) {
00103 HotDeploymentTool tool = (HotDeploymentTool) e.nextElement();
00104 tool.validateAttributes();
00105 tool.deploy();
00106 }
00107 }
00108
00110
00111
00112
00114
00119 public String getAction() {
00120 return action;
00121 }
00122
00129 public void setAction(String action) {
00130 this.action = action;
00131 }
00132
00138 public File getSource() {
00139 return source;
00140 }
00141
00147 public void setSource(File source) {
00148 this.source = source;
00149 }
00150 }