Skip to content
Snippets Groups Projects
Commit ed2d6918 authored by tjc's avatar tjc
Browse files

tidy

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@13780 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 5fa42b52
Branches
Tags
No related merge requests found
...@@ -128,48 +128,22 @@ public class ExternalProgram ...@@ -128,48 +128,22 @@ public class ExternalProgram
// sequence_file_names will be set by prepareRun() // sequence_file_names will be set by prepareRun()
final File file_of_filenames = prepareRun(features, sequence_file_names); final File file_of_filenames = prepareRun(features, sequence_file_names);
// final Integer job_control_id =
// Options.getOptions().getIntegerProperty("jcon_" + getName() +
// "_program_id");
// final Integer min_jc_jobs =
// Options.getOptions().getIntegerProperty("jcon_min_jobs");
// String jcon_template =
// Options.getOptions().getProperty("jcon_" + getName() + "_template");
// final String jcon_batch_queue =
// Options.getOptions().getProperty("jcon_batch_queue");
// if(job_control_id != null &&
// min_jc_jobs != null &&
// jcon_template != null &&
// jcon_batch_queue != null &&
// features.size() >= min_jc_jobs.intValue())
// {
// return ExternalProgramUtils.runJConProgram(this, features,
// sequence_file_names, logger);
// }
// else
// {
try try
{ {
if( System.getProperty("j2ssh") != null && if( System.getProperty("j2ssh") != null &&
!System.getProperty("j2ssh").equals("false") && !System.getProperty("j2ssh").equals("false") &&
(getRealName().indexOf("blast") > -1 || getRealName().startsWith("fast"))) (getRealName().indexOf("blast") > -1 || getRealName().startsWith("fast")))
{ {
logger4j.debug("GET READY TO CALL SSH CLIENT " + getRealName()); logger4j.debug("GET READY TO CALL SSH CLIENT " + getRealName());
final Feature this_feature = features.elementAt(0); final Feature this_feature = features.elementAt(0);
Entry entry = this_feature.getEntry(); Entry entry = this_feature.getEntry();
String[] args; String[] args;
if(((DocumentEntry)entry.getEMBLEntry()).getDocument() if (((DocumentEntry) entry.getEMBLEntry()).getDocument() instanceof RemoteFileDocument)
instanceof RemoteFileDocument)
{ {
RemoteFileDocument nodeDoc = RemoteFileDocument nodeDoc = (RemoteFileDocument) (((DocumentEntry) entry
(RemoteFileDocument)(((DocumentEntry)entry.getEMBLEntry()).getDocument()); .getEMBLEntry()).getDocument());
RemoteFileNode node = nodeDoc.getRemoteFileNode(); RemoteFileNode node = nodeDoc.getRemoteFileNode();
String wdir = node.getRootDir() + "/" + node.getFullName(); String wdir = node.getRootDir() + "/" + node.getFullName();
...@@ -178,57 +152,55 @@ public class ExternalProgram ...@@ -178,57 +152,55 @@ public class ExternalProgram
args = new String[9]; args = new String[9];
args[0] = "-f"; args[1] = file_of_filenames.getPath(); args[0] = "-f";
args[2] = "-cmd"; args[3] = getRealName(); args[1] = file_of_filenames.getPath();
args[4] = "-wdir"; args[5] = wdir; args[2] = "-cmd";
args[6] = "-d"; args[7] = getProgramOptions(); args[3] = getRealName();
args[4] = "-wdir";
args[5] = wdir;
args[6] = "-d";
args[7] = getProgramOptions();
args[8] = "-keep"; args[8] = "-keep";
} }
else else
{ {
args = new String[6]; args = new String[6];
args[0] = "-f"; args[1] = file_of_filenames.getPath(); args[0] = "-f";
args[2] = "-cmd"; args[3] = getRealName(); args[1] = file_of_filenames.getPath();
args[4] = "-d"; args[5] = getProgramOptions(); args[2] = "-cmd";
args[3] = getRealName();
args[4] = "-d";
args[5] = getProgramOptions();
} }
logger4j.debug("CALL SSH CLIENT " + getRealName()); logger4j.debug("CALL SSH CLIENT " + getRealName());
uk.ac.sanger.artemis.j2ssh.SshPSUClient ssh = new uk.ac.sanger.artemis.j2ssh.SshPSUClient(
uk.ac.sanger.artemis.j2ssh.SshPSUClient ssh = args);
new uk.ac.sanger.artemis.j2ssh.SshPSUClient(args);
ssh.start(); ssh.start();
new ProgressBarFrame(1, getName()); new ProgressBarFrame(1, getName());
return null; return null;
} }
final String[] arguments; final String[] arguments;
switch (program_type) switch (program_type)
{ {
case DNA_PROGRAM: case DNA_PROGRAM:
// fall through // fall through
case AA_PROGRAM: case AA_PROGRAM:
arguments = new String[] arguments = new String[]
{ { file_of_filenames.getPath(), getProgramOptions() };
file_of_filenames.getPath(),
getProgramOptions()
};
break; break;
case APPLICATION: case APPLICATION:
arguments = new String[] arguments = new String[]
{ { file_of_filenames.getPath(), };
file_of_filenames.getPath(),
};
break; break;
default: default:
throw new Error("internal error - unknown program type"); throw new Error("internal error - unknown program type");
} }
final Process process = final Process process = startProgram("run_" + getRealName(), arguments);
startProgram("run_" + getRealName(), arguments);
//
// //
new ProgressBarFrame(1, getName()); new ProgressBarFrame(1, getName());
return new ProcessMonitor(process, getName(), logger); return new ProcessMonitor(process, getName(), logger);
...@@ -236,11 +208,9 @@ public class ExternalProgram ...@@ -236,11 +208,9 @@ public class ExternalProgram
catch (SecurityException e) catch (SecurityException e)
{ {
// re-throw as an ExternalProgramException // re-throw as an ExternalProgramException
throw new ExternalProgramException("SecurityException while running " + throw new ExternalProgramException("SecurityException while running "
getName() + ": " + + getName() + ": " + e.getMessage());
e.getMessage());
} }
// }
} }
...@@ -298,7 +268,7 @@ public class ExternalProgram ...@@ -298,7 +268,7 @@ public class ExternalProgram
File first_directory = null; File first_directory = null;
// stores the number of features in each directory // stores the number of features in each directory
final Hashtable feature_count_hash = new Hashtable(); final Hashtable<File, Long> feature_count_hash = new Hashtable<File, Long>();
for(int i = 0 ; i < features.size() ; ++i) for(int i = 0 ; i < features.size() ; ++i)
{ {
...@@ -341,12 +311,12 @@ public class ExternalProgram ...@@ -341,12 +311,12 @@ public class ExternalProgram
node = nodeDoc.getRemoteFileNode(); node = nodeDoc.getRemoteFileNode();
} }
final java.util.Hashtable file_number_hash = new java.util.Hashtable(); final Hashtable<File, Long> file_number_hash = new Hashtable<File, Long>();
for(final Enumeration e = feature_count_hash.keys() ; for(final Enumeration<File> e = feature_count_hash.keys() ;
e.hasMoreElements() ;) e.hasMoreElements() ;)
{ {
final File directory =(File) e.nextElement(); final File directory = e.nextElement();
final long old_file_number = getFileNumber(directory, node); final long old_file_number = getFileNumber(directory, node);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment