1 package org.jbpm.ant; 2 3 import org.apache.tools.ant.BuildException; 4 import org.apache.tools.ant.Task; 5 6 public class StartHsqldbTask extends Task { 7 8 String lib; 9 String database; 10 String port; 11 12 public StartHsqldbTask() { 13 } 14 15 public void execute() throws BuildException { 16 try { 17 String command = "java -cp "+ lib + 19 " org.hsqldb.Server " + 20 " -database " + database + 21 " -port "+port; 22 23 Thread launcher = new Launcher(this, command, "is online"); 25 launcher.start(); 26 launcher.join(); 27 28 } catch (Throwable t) { 29 t.printStackTrace(); 30 } 31 } 32 33 public void setDatabase(String database) { 34 this.database = database; 35 } 36 public void setLib(String lib) { 37 this.lib = lib; 38 } 39 public void setPort(String port) { 40 this.port = port; 41 } 42 } 43 | Popular Tags |