1 26 27 package org.objectweb.jonas.ant.jonasbase; 28 29 import java.io.File ; 30 31 import org.apache.tools.ant.BuildException; 32 33 import org.objectweb.jonas.ant.JOnASBaseTask; 34 35 39 public class Db extends JTask implements BaseTaskItf { 40 41 44 private static final String INFO = "[DB] "; 45 46 49 private static final String PORT_PROPERTY = "jonas.service.db.port"; 50 51 54 private String portNumber = null; 55 56 59 public Db() { 60 super(); 61 } 62 63 67 public void setPort(String portNumber) { 68 this.portNumber = portNumber; 69 } 70 71 72 75 private void checkProperties() { 76 if (portNumber == null) { 77 throw new BuildException(INFO + "Property 'portNumber' is missing."); 78 } 79 } 80 81 84 public void execute() { 85 checkProperties(); 86 87 String jBaseConf = getDestDir().getPath() + File.separator + "conf"; 89 90 changeValueForKey(INFO, jBaseConf, JOnASBaseTask.JONAS_CONF_FILE, 91 PORT_PROPERTY, portNumber, false); 92 93 94 } 95 } | Popular Tags |