Methods Summary |
---|
protected void | cleanDir(java.lang.String resultDir)
Delete delete = (Delete)getProject().createTask("delete");
delete.setDir(new File(resultDir));
delete.setQuiet(true);
delete.setIncludeEmptyDirs(true);
delete.execute();
|
protected org.apache.tools.ant.types.Path | constructJVMPath()
StringBuffer classPathBuffer = new StringBuffer();
classPathBuffer.append(avk_home+"/lib/javke.jar:");
classPathBuffer.append(j2ee_home+"/lib/appserv-rt.jar:");
classPathBuffer.append(j2ee_home+"/lib/javaee.jar:");
classPathBuffer.append(j2ee_home+"/lib/appserv-ext.jar:");
classPathBuffer.append(j2ee_home+"/lib/appserv-cmp.jar:");
classPathBuffer.append(j2ee_home+"/lib/appserv-admin.jar:");
classPathBuffer.append(j2ee_home+"/lib/install/applications/jmsra/imqjmsra.jar:");
classPathBuffer.append(j2ee_home+"/lib/jhall.jar:");
// classPathBuffer.append(Path.systemClasspath);
return new Path(getProject(),classPathBuffer.toString());
|
private void | createEchoTask()
echo = (Echo)getProject().createTask("echo");
|
protected org.apache.tools.ant.taskdefs.Java | createJavaTask()Create a java task with classpath and JVM arguments set
Java java = (Java)project.createTask("java");
java.setClasspath(constructJVMPath());
if(jvmArgs == null)
jvmArgs = "-Xss512k -Xms128m -Xmx256m";
setCommonVMSettings(java);
setSystemProperties(java);
return java;
|
protected void | createResultDir(java.lang.String dirName)creates the directory dirName ( static, scan or translate) in the
"avk_home/reporttool" directory.
if(resultDir == null)
resultDir = avk_home+File.separator + "reporttool";
resultDir = resultDir + File.separator +dirName;
File file = new File(resultDir);
try {
cleanDir(resultDir);
if ( file.getParent() !=null) {
(new File (file.getParent())).mkdirs();
file.mkdir();
}
}catch( Exception e) {
throw new BuildException("Could not create output directory "+resultDir);
}
|
protected void | getInstallHomes()
// create the echo task that displays the messages
createEchoTask();
if(avk_home == null)
try {
avk_home = new File(getProject().getProperty("avk.home")).getCanonicalPath();
} catch (IOException e) {//we donot expect this exception. Continue with absolutePath anyway
avk_home = new File(getProject().getProperty("avk.home")).getAbsolutePath();
}
try {
File avkENV = new File(avk_home+File.separatorChar+"config", "avkenv.conf");
Properties props = new Properties();
props.load(new FileInputStream(avkENV));
if(j2ee_home == null)
try {
j2ee_home = new File(props.getProperty("J2EE_HOME")).getCanonicalPath();
} catch (IOException e) {//we donot expect this exception. Continue with absolutePath anyway
j2ee_home = new File(props.getProperty("J2EE_HOME")).getAbsolutePath();
}
} catch (IOException e) {
echo.setMessage("Problem in getting J2EE_HOME. Please ensure that avkenv.conf " +
"is kept in the config directory. "+e.getMessage());
echo.execute();
}
|
protected void | setArgs(org.apache.tools.ant.taskdefs.Java java, java.lang.String[] args)
for (int i = 0; i < args.length; i++) {
java.createArg().setLine(args[i] + " ");
}
|
protected void | setCommonVMSettings(org.apache.tools.ant.taskdefs.Java java)
java.setFork(true);
java.setFailonerror(failOnError);
// java.setDir(new File(avk_home, "bin"));
java.createJvmarg().setLine(jvmArgs);
|
public void | setFailOnError(boolean failOnError)
this.failOnError = failOnError;
|
public void | setJvmArgs(java.lang.String jvmArgs)
this.jvmArgs = jvmArgs;
|
protected void | setResultDir(java.lang.String resultDir)
this.resultDir = resultDir.trim();
|
protected void | setSystemProperties(org.apache.tools.ant.taskdefs.Java java)
Environment.Variable j2ee_app_home = new Environment.Variable();
j2ee_app_home.setKey("j2ee.appverification.home");
j2ee_app_home.setValue(avk_home);
java.addSysproperty(j2ee_app_home);
Environment.Variable java_ext_dir = new Environment.Variable();
java_ext_dir.setKey("java.ext.dirs");
java_ext_dir.setValue(System.getProperty("java.ext.dirs") +
File.pathSeparator + j2ee_home +
File.separator + "domains" +
File.separator + "domain1" +
File.separator + "lib" +
File.separator + "ext");
java.addSysproperty(java_ext_dir);
Environment.Variable installRoot = new Environment.Variable();
installRoot.setKey("com.sun.aas.installRoot");
installRoot.setValue(j2ee_home);
java.addSysproperty(installRoot);
// following 2 are required for the migration code
Environment.Variable j2eeHome = new Environment.Variable();
j2eeHome.setKey("j2ee.home");
j2eeHome.setValue(j2ee_home);
java.addSysproperty(j2eeHome);
Environment.Variable javaHome = new Environment.Variable();
javaHome.setKey("as.java");
javaHome.setValue(java_home);
java.addSysproperty(javaHome);
Environment.Variable endorsedDir = new Environment.Variable();
endorsedDir.setKey("java.endorsed.dirs");
endorsedDir.setValue(j2ee_home+File.separator + "lib" + File.separator + "endorsed");
java.addSysproperty(endorsedDir);
Environment.Variable xsl = new Environment.Variable();
xsl.setKey("com.sun.aas.verifier.xsl");
xsl.setValue(avk_home + File.separator + "xsl");
java.addSysproperty(xsl);
|