1 18 package org.apache.roller.ant; 19 20 import org.apache.tools.ant.BuildException; 21 import org.apache.tools.ant.Task; 22 import org.hsqldb.Server; 23 24 28 public class StartHsqldbTask extends Task 29 { 30 private String database = null; 31 private String port = null; 32 public void execute() throws BuildException 33 { 34 if (database != null) { 35 Thread server = new Thread () { 36 public void run() { 37 System.out.println("Starting HSQLDB"); 38 String [] args = { 39 "-database", database, 40 "-port", port, 41 "-no_system_exit", "true" }; 42 Server.main(args); 43 } 44 }; 45 server.start(); 46 } 47 try {Thread.sleep(2000);} catch (Exception ignored) {} 48 } 49 52 public String getDatabase() 53 { 54 return database; 55 } 56 59 public void setDatabase(String database) 60 { 61 this.database = database; 62 } 63 66 public String getPort() 67 { 68 return port; 69 } 70 73 public void setPort(String port) 74 { 75 this.port = port; 76 } 77 } 78 | Popular Tags |