00001
00026 package org.objectweb.jonas.ant.jonasbase;
00027
00028 import java.io.File;
00029
00030 import org.apache.tools.ant.BuildException;
00031
00032 import org.objectweb.jonas.ant.JOnASBaseTask;
00033
00038 public class Services extends JTask implements BaseTaskItf {
00039
00043 private static final String INFO = "[JOnAS] ";
00044
00048 private static final String SERVICES_PROPERTY = "jonas.services";
00049
00053 private String serviceNames = null;
00054
00058 public Services() {
00059 super();
00060 }
00061
00066 public void setNames(String serviceNames) {
00067 this.serviceNames = serviceNames;
00068 }
00069
00073 private void checkProperties() {
00074 if (serviceNames == 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, SERVICES_PROPERTY, serviceNames, false);
00088
00089 }
00090
00091 }