00001
00026 package org.objectweb.jonas.ant.jonasbase;
00027
00028 import java.io.File;
00029
00030 import org.apache.tools.ant.BuildException;
00031 import org.objectweb.jonas.ant.JOnASBaseTask;
00032
00037 public class Dbm extends JTask implements BaseTaskItf {
00038
00042 private static final String INFO = "[DBM] ";
00043
00047 private static final String DATASOURCES_PROPERTY = "jonas.service.dbm.datasources";
00048
00052 private String dataSources = null;
00053
00057 public Dbm() {
00058 super();
00059 }
00060
00065 public void setdataSources(String dataSources) {
00066 this.dataSources = dataSources;
00067 }
00068
00069
00073 private void checkProperties() {
00074 if (dataSources == null) {
00075 throw new BuildException(INFO + "Property 'dataSource ' is missing.");
00076 }
00077 }
00078
00082 public void execute() {
00083 checkProperties();
00084
00085
00086 String jBaseConf = getDestDir().getPath() + File.separator + "conf";
00087 changeValueForKey(INFO, jBaseConf, JOnASBaseTask.JONAS_CONF_FILE,
00088 DATASOURCES_PROPERTY, dataSources, false);
00089
00090
00091 }
00092 }