1 22 package org.jboss.ant.taskdefs.server; 23 24 import java.io.IOException ; 25 26 import org.apache.tools.ant.BuildException; 27 import org.apache.tools.ant.Task; 28 import org.jboss.test.util.server.ServerManager; 29 30 36 public class StopServerTask extends Task 37 { 38 39 private String name; 40 41 44 45 public void execute() throws BuildException 46 { 47 ServerManager manager = (ServerManager) getProject().getReference(ConfigManagerTask.MANAGER_REF); 48 try 49 { 50 manager.stopServer(name); 51 } 52 catch (IOException e) 53 { 54 throw new BuildException("Error starting server \"" + name + "\": " + e.toString(), e); 55 } 56 } 57 58 63 public void setName(String name) 64 { 65 this.name = name; 66 } 67 } | Popular Tags |